in reply to Re: Speeding permutation counting
in thread Speeding permutation counting

This is a significant improvement. I knew there would be something to do with bitwise operators, but I was not versed enough to come up with such a solution.

This is giving the following benchmarks:

Rate orig blokchop browserUK orig 1178/s -- -69% -94% blokchop 3829/s 225% -- -81% browserUK 20097/s 1606% 425% --
In my testing, this is improving about 17x on my original, and about 5x on blokhead's chop based solution.

Thanks for the excellent suggestion,
-a