suggested improvements to D

Don Clugston dac at nospam.com.au
Tue Jan 9 23:28:50 PST 2007


Witold Baryluk wrote:
> Tabelarising number of nonzero bits in char[256], and
> applying it to each 8bit group in 32bit integer, can be quicker.

It can be (and certainly was always true in the days of the 286), but 
table lookups always run the risk of falling out of the data cache (and 
this is something a simple benchmark won't find). On most recent CPUs, 
cache misses are horribly expensive, and even one cache miss every 1000 
calls will easily wipe out any small performance benefits you'd 
otherwise expect from the table lookup.



More information about the Digitalmars-d mailing list