Open samchon opened 3 years ago
Change the hash buckets not to using the mod (%) operator but the bitwise and (&) operator . If size of the hash buckets always be multiple of 2, the ^ operation can replace the % operation and it can reduce elapsed time about 10 percent.
Modulo and Division vs Bitwise Operations https://mziccard.me/2015/05/08/modulo-and-division-vs-bitwise-operations/
https://mziccard.me/2015/05/08/modulo-and-division-vs-bitwise-operations/
Change the hash buckets not to using the mod (%) operator but the bitwise and (&) operator . If size of the hash buckets always be multiple of 2, the ^ operation can replace the % operation and it can reduce elapsed time about 10 percent.