The Memory Hierarchy
Throughout this chapter, I’ve discussed caches that are used to store data that is pulled from an external source such as the Internet. However, caches are used in many other contexts as well, including in the hardware of our computers. In fact, understanding how this hardware works can enable us to write more efficient day-to-day code. So, let’s talk hardware.
It’s generally understood that a computer has memory. A computer’s memory is where a computer stores all its data, from entire files to the tiny variables we create with our code. However, our computer doesn’t simply store all data in one huge container. Instead, a computer’s memory is partitioned into a number of different levels. And here’s the interesting thing: ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access