> Beating the compiler at signed 32-bit division > 31 October 2026 路 10 min > Di...

@dougmerritt@mathstodon.xyz

> Beating the compiler at signed 32-bit division
> 31 October 2026 路 10 min
> Dividing integers is slow on our processors. A 32-bit division costs:
[ table showing 7-12 cycles, depending ]
lemire.me/blog/2026/10/31/beat

And that's 32 bit, not 64, which it goes on to point out is even slower.

People forget that not all instructions are ~1 cycle.

Lemire, the author, is "sans peur et sans reproche" on the subject of algorithmic efficiency.