next up previous contents
Next: 16.2.2 Store Data in Up: 16.2.1 Optimize Cache and Previous: 16.2.1 Optimize Cache and

Minimizing Cache Misses.

Most CPU's have first-level instruction and data caches on chip and many have second-level cache(s) that are bigger but somewhat slower. Memory accesses are much faster if the data is already loaded into the first-level cache. When your program accesses data that isn't in one of the caches, it gets a cache miss. This causes a block of consecutively addressed words, including the data that you just accessed, to be loaded into the cache. Since cache misses are costly, you should try to minimize them, using these tips:



David Blythe
Thu Jul 17 21:24:28 PDT 1997