Comment by shric
A fun read on word count optimization can be found in Abrash's Black Book:
https://www.jagregory.com/abrash-black-book/#lessons-learned...
You can gloss over the asm if you wish, the tricks that are explained around it are worth it imho.
I wonder if large lookup tables/table-driven state machines are still as good as they used to be. After all, even with all the on-chip caches, the additional memory accesses today seem to be slower than doing some multi-instruction SIMD voodoo.