Locality of reference

In computer science is with locality property (English: locality of reference ) denotes the observable characteristic of typical computer programs within a certain period of time to access only a relatively small area of the total data. It forms the basis for the use of a cache.

Types of localities

A distinction is made between the spatial and temporal locality.

  • Temporal locality: At a certain time interval is carried out with a relatively small area of the total amount of data or command.
  • Spatial locality: instruction or data accesses take place on a relatively small area of ​​the entire address space.

The localities are grounded on the following observation:

The instructions of a program are executed sequentially, which is only interrupted by occurring in the source code branches. The following commands are therefore very likely also processed. Branches find it largely only in loops and procedures instead, which are often run more than once repeated. Branches to remote addresses that violate the locality, it is relatively rare.

In addition, the repeated execution of the same command sequence leads to a renewed access to program data.

Other effects

A resulting reflection results in the development of operating systems to the fact that memory pages that have been accessed most recently before a long time, be paged to favor more recent pages.

In this compiler must be noted that this locality properties can be exploited by the use of a cache.

  • Computer Architecture
  • Operating system theory
  • Compiler
527684
de