3.5. Data Locality

As described above, caches work on the assumption that data that is accessed once will usually be accessed soon again. This kind of behaviour is known as data locality. There are two kinds of locality that are sometimes distinguished:

It is of course possible for a program exhibit both types of locality at the same time.

Good data locality is essential for good application performance. Applications with poor data locality reduce the effectiveness of the cache, causing long stall times waiting for memory accesses.