4 ms·
Most code is naive. FWIW, in my experience most people who just look around for poor code locality focus on things that don't actually matter, while the most ex
by saagarjha 3y ago
Most code is naive. FWIW, in my experience most people who just look around for poor code locality focus on things that don't actually matter, while the most expensive misses (when you actually profile and decide you care about them) end up in surprising places, or they were just missed in someone's quest to reorder all the structs they see in the codebase.
- meheleventyone 3y agoIt’s memory not code locality (do you mean in the instruction cache or something else?) that matters. The problem for a naive solution with poor memory locality is that the memory locality issue is more akin to a rewrite to a faster language. The performance gap left on the table can be significant but the need for it not show up in profiles because everything is slow.
- saagarjha 3y agoThat is very often the case, yes.