The Principle of Locality
The Principle of Locality:
- Program access a relatively small portion of the address space at any instant of time.
- Example: 90% of time in 10% of the code
Two Different Types of Locality:
- Temporal Locality (Locality in Time): If an item is referenced, it will tend to be referenced again soon.
- Spatial Locality (Locality in Space): If an item is referenced, items whose addresses are close by tend to be referenced soon.