willf/bitset — pull request #12 by lemire (2014-02-08 06:26:19+00:00)
Title: Implemented a way to iterate over the set bits

Seems like providing a way to iterate over the set bits is a must. I have implemented "something", it is not great but it is going to work and be reasonably efficient. I am sure you can make it more Go-like. I couldn't quite figure out how to make it prettier.

(Oh! A very similar function can be written to iterate over the unset bits.)

Other than that...

I played quite a bit tonight with your library. I thought it'd be easy to optimize it out by calling C functions. But all my work was in vain... turns out that the over to calling C functions is too high (with cgo). There are fancier ways to do it, of course, but I did not bother investigating further.

I still think that switching your code over to 64-bit words would make it run faster, but I am now exhausted so I'll stop here.