Beating an optimising compiler at compiling division calculations: https://lemire.me/blog/2019/02/08/faster-remainders-when-the-divisor-is-a-constant-beating-compilers-and-libdivide/
(TIL that gcc, clang and libdivide use different techniques!)
miniblog.
Related Posts
A great deep dive on building GitHub's code view, optimising React, scaling to thousands whilst supporting both Ctrl-F and syntax highlighting:
Optimising GHC, implementing assembly pretty-printers, and the tradeoffs of implementing against an interface: https://www.tweag.io/blog/2022-12-22-making-ghc-faster-at-emitting-code/
Interpreters versus compilers as a spectrum, and a fun worked example of optimising Brainfuck:
