Closed rzuckerm closed 1 year ago
@rzuckerm Thanks for submitting this. The changes themselves look good to me, but I did notice something else that I must have missed when I reviewed the version of the solution that's in the current codebase: you use the same label ("rzuckerm") in the drag-race output line for both implementations included in this solution. Could you please label each of them differently? It makes it easier to distinguish the implementations in the output of the automated benchmark runs (like shown in PrimeView, for example).
A very simple solution would be to change the one for the bit-level implementation to "rzuckerm-bit", but any other approach that leads to different labels would also be fine. I apologize for missing this before.
@rbergen Done
Thank you!
Description
For the both implementations, I moved the sieve definition inside the main prime loop to ensure that it keeps getting reallocation every iteration.
For the packed bit implementation (
primes_bit.ex
), I inlined the bit operations. This improved the speed by a factor of about 2.1x.Contributing requirements
drag-race
as the target branch.