Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: Programmers Nostrums

by ambrus (Abbot)
on Nov 24, 2009 at 21:46 UTC ( #809212=note: print w/replies, xml ) Need Help??

in reply to Programmers Nostrums

Use a table, even if most of the entries are the same/empty, it makes your logic simpler and computers like them (remember this was when you sweated over every byte your code used).

No, that was back when the CPU would run on the same frequency as the RAM so you didn't have to think about caching. Nowadays looking up something in a large table can be expensive because accessing RAM is slow, but on the other hand conditional jumps can be expensive too because of prefetching and decoding, so figuring out what takes more time is much more complicated. (But at least there's still good documentation (eg.) so if you really take the time to RTFM then you can make an educated guess.)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://809212]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2016-10-23 16:48 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (301 votes). Check out past polls.