In “What Every Programmer Should Know About Memory,” the author explains how memory works in modern computers and its impact on performance. Despite being written in 2007, the paper has aged well due to the limitations of physics, such as the size of transistors and the speed of light. Caches are used to overcome these limitations and create the illusion of fast memory. The author emphasizes the importance of good memory locality and the need to write code that is easy to understand and maintain. They suggest keeping the code base small, minimizing dependencies, and avoiding duplication. The author also discusses the benefits of deep modules and inlining variables and functions.
https://loup-vaillant.fr/articles/physics-of-readability