Locality Of References

This important fundamental observation comes from properties of programs. The most important program property that we regularly exploit is locality of references : Programs tend to reuse data and instructions they have used recently.

90/10 rule comes from empirical observation:
"A program spends 90% of its time in 10% of its code"

An implication of locality is that we can predict with reasonable accuracy what instructions and data a program will use in the near future based on its accesses in the recent past.

Two different types of locality have been observed:

bullet Temporal locality: states that recently accessed items are likely to be accessed in the near future.

bullet Spatial locality: says that items whose addresses are near one another tend to be referenced close together in time.