4 ms·
You'll get no argument from me that most software is bloated and slow compared to what is possible. (I spent a lot of my career working on making code run fast!
by Dave_Rosenthal 4y ago
You'll get no argument from me that most software is bloated and slow compared to what is possible. (I spent a lot of my career working on making code run fast!)
But it feels wrong to say that the caches are wasted. The code we write do not explicitly control the L1/L2 caches. So whether the code we are running is super-optimized or super-bloated, the caches are responding to what's actually being accessed to make that code run as efficiently as it can.
- karmakaze 4y agoBut we do influence how effectively L1/L2 caches are used. Each time we have a choice to split some fields into two objects or not, they can be allocated/cached together or separately. This is one of the huge outcomes of Java's project Valhalla to have Value objects that live 'in-place' rather than separately, the way embedded structs do in Go.