Source: Hacker News
Article note: There are some fun tricks in here that I'm vaguely aware of, but I love the nice intuitive demos.
Bunch of classic packing and compression hacks. Standard "memory allocator is bullshit; consistent under the upper bound wins over fragmentation" type optimizations.
Z-order curves (linearizing a n-space in a locality-preserving way) are a thing, but this is a lovely illustration.
Using (n & -n) == n; as "Is power of 2" for 2s compliment.
It's a fun read.
Comments
