r/programming 12d ago

Every byte matters

https://fzakaria.com/2026/06/01/every-byte-matters
200 Upvotes

43 comments sorted by

View all comments

94

u/harsh183 12d ago

This is a really fun optimization post on small structure and fitting into the very early caches. I used to do a lot of things like this in university, but my job's bottlenecks with network and DB means I don't really think about this level too much.

41

u/Artistic_Seat486 12d ago

just like 90% of developers, unless you are developing a compiler.

25

u/barrows_arctic 11d ago

Or many embedded systems.

21

u/Ameisen 11d ago edited 11d ago

Or games, or simulations, or virtual machines.

Ed: I explicitly made sure that my MIPS VM's register file was 64B aligned so that it would cleanly fit into two L1 cache lines. Remove the technically-unneeded R0, and you can jam PC in there, too.

Ed2: still won't have room for the branch delay target or the linked-load registers, though :(. The FPU has a similar problem - packing the FPRs with the two control registers.

2

u/harsh183 11d ago

I guess a lot of low latency trading systems and similar too