# What is the basic idea behind the usage of TLBs?

I know how Translation Lookaside Buffers work, and i also know we use them to improve the performance of data/program access by storing the recent page numbers - frame numbers in a memory cache. The problem is that i can't understand why frequent memory locations are acccessed in a period of time? And what was the starting point of this idea:

"Since the same memory locations are accessed frequently, We can create a place to hold the frequent translations so that make everything happen faster."

Can someone please share the knowledge behind this concept? Thanks.

• The same observation is also behind caches. It is not so surprising that memory accesses are clustered rather than random – just think of one of the algorithms you studied in algorithms class, say (in-place) sorting. – Yuval Filmus Jun 15 '17 at 19:40
• The technical term is "locality of reference" and specifically temporal and spatial locality of reference. – Derek Elkins Jun 16 '17 at 1:22

The nature of the TLB amplifies this effect because it doesn't only kick in when accessing the same data, but more generally when accessing data in the same page. This happens even when each individual bit is only accessed once. For example, consider a simple array traversal, that accesses the array elements in order. Assume that elements are smaller than one page, say $k$ elements fit in a page. Then a single MMU lookup is needed for the first element in a page, and the next $k-1$ only require a TLB lookup.