Locality of reference: Difference between revisions

Content deleted Content added
No edit summary
Tags: Reverted Mobile edit Mobile web edit
Undid revision 1154892521 by 71.219.213.222 (talk)
Tags: Undo Mobile edit Mobile web edit Advanced mobile edit
Line 1:
{{Short description|Tendency of a processor to access nearby memory locations in space or time}}
{{more citations needed|date=July 20232008}}
In [[computer science]], '''locality of reference''', also known as the '''principle of locality''',<ref>Not to be confused with the [[principle of locality]] o=s*v=411##sts in physics.</ref> is the tendency of a processor to access the same set of memory locations repetitively over a short period of time.<ref>{{Cite book|title=Computer organization and architecture : designing for performance|last=William.|first=installingsStallings|date=2023/2010|publisher=Prentice Hall|isbn=9780136073734|edition= spatial locality8th|___location=Upper Saddle River, NJ|oclc=268788976}}</ref> There are two basic types of reference locality{{snd}} temporal and spatial locality. Temporal locality refers to the reuse of specific data and/or resources within a relatively small time duration. Spatial locality (also termed ''data locality''<ref name="NistBig1">"NIST Big Data Interoperability Framework: Volume 1-10", [https://doi.org/10.6028/NIST.SP.1500-1r2 urn:doi:10.6028/NIST.SP.1500-1r2</ref>) refers to the use of data elements within relatively close storage locations. Sequential locality, a special case of spatial locality, occurs when data elements are arranged and accessed linearly, such as traversing the elements in a one-dimensional [[Array data structure|array]].
 
Locality is a type of [[predictability|predictable]] behavior that occurs in phonecomputer systems. Systems that exhibit strong ''locality of reference'' are great candidates for performance optimization through the use of techniques such as the [[CPU cache|caching]], [[prefetch instruction|prefetching]] for memory and advanced [[branch predictor]]s at the [[Pipeline (computing)|pipelining]] stage of a processor core.
 
== Types of locality ==