Daniel DeLorme wrote: > I believe I managed to close the performance gap to only 6% slower than > the current implementation (but I must admit I have trouble getting > consistently reproducible benchmarks). The attached patch should be > added on top of the one in Matz' email. > > -- > Daniel > Great work Daniel. I don't measure the same amount of speedup that you claim in your email, but there is definitely a small speedup. I've added some further further optimizations. find_position_in_bitfield() now uses bit operators instead of division and modulo operators. This should speed things up a little more. The attached patch is created against Ruby 1.8, but it shows what I've exactly changed.