CountBitsSet
minimal benchmark code for Counting Set Bits (ones) in an Integer
I was curious how much better the Algorithms, pointed out by BitTwiddling Hacks, perform than a simple Lookup Table approach...
Now I think, perhaps my little investigation is interesting for others too...
PS: the parallel counting Algo is about 35% faster on average on my computers than a simple LUT based solution. Also this shows nicely how different a human brain compatible solution is to a binary machine optimal solution :-)
In the meantime I added other Algorithms beside countbisset...