Locality of reference is a phenomenon that can be seen in Computer science. It says that the same value, or the place where it is stored is accessed often. There are two different kinds of locality of reference:
- Temporal locality: If a value is referenced, there is a high probability it will be referenced again a short time from now
- Spatial locality: A value is stored in a certain location in storage (memory, disk,..). If this location is referenced, it is very probable that locations that are physically close to it will be referenced as well.