liveBook · Manning

CPU cache

As explained in High Performance Unity Game Development

A small, fast memory near a processor core that stores data for quicker access than main memory.

Moving an enemy requires only a small calculation using its position, direction, and velocity, but retrieving that data can make the CPU wait. A CPU cache stores data close to where it is processed, so cached data is faster to access than data in main memory. Organizing data so the CPU retrieves more of what the logic needs can make better use of the cache. section 1.2.1

Figure 1.4 The cache sits directly on the CPU die and is physically small. Retrieving data from the cache is significantly faster than retrieving data from main memory.

The figure shows the cache’s location on the CPU die and its faster access compared with main memory. section 1.2.1

How High Performance Unity Game Development covers it

How deep it goes
Defines caches and explains their role in reducing waits, without detailing cache hierarchy or hardware behavior.
Examples
Uses enemy movement, calculated from position, direction, and velocity, to illustrate data-access delays.
What you can do after
Understand how organizing data can help the CPU use its cache and reduce trips to main memory.
How it connects
Connects CPU caches with main memory, data-oriented design, and data organization.

Also explained in

Compare how 4 books explain CPU cache →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of High Performance Unity Game Development. The section links point to the parts of the book it draws on.