We found this out, when we were optimizing image processing pipelines (image processing uses lots of lookup tables).
We found that the best way to optimize was to avoid moving out of cache, so we had to rewrite a lot of our stuff, so it never broke cache.
That meant a lot of copy-and-paste repetition, strict (small) static functions, and hardcoded values, instead of properties or even constants.
I don't remember all the stuff we learned, but it wasn't pretty (and applied only to x86 architecture. Not sure how well it would work, these days, on ARM).