Reuse distance
Reuse distance counts distinct identities accessed strictly between consecutive references to the same cache entry.
Immediate repetition has distance zero; a first appearance has no finite distance in a cold-start trace. Under equal-size, fully associative LRU with immediate demand admission, a reuse hits when its distance d is less than capacity C. Equality is a miss. [1]
Some literature instead reports a one-based stack position s = d + 1, which hits when s <= C. Check the convention before comparing values or thresholds. [2]
Exact analysis with a balanced tree and hash table uses O(N log M) time and O(M) space for N references and M identities. SHARDS samples identities by hash and rescales distances; its memory-bounded variant adapts the sampling rate. [4]
Reported accuracy: with an 8K sample cap across 124 traces, fixed-size SHARDS had median per-trace MAE 0.0072 and maximum 0.078; the adjusted variant had 0.0027 and 0.017. MAE averages absolute miss-ratio differences over evaluated cache sizes. Neither statistic bounds error at every capacity or guarantees accuracy on another workload. [4]
Efficient exact evaluation keeps one last-access timestamp per identity and counts active timestamps after the preceding occurrence. Ding and Zhong describe this counting approach. Hesela's bounded evaluator uses a binary indexed tree with O(N) positional storage, distinct from a tree with O(M) storage for M unique identities. [1]
Relations
- related
- Least recently used replacement, Miss-ratio curve, Cache inclusion property, SSD mapping cache, Adaptive Replacement Cache, Working set, Locality of reference, Low inter-reference recency set replacement, Linux refault distance, CLOCK-Pro, Reuse time, Move-to-front transform, SHARDS, StatStack, Counter Stacks
Advantages
- One pass that collects a reuse-distance histogram yields the LRU miss ratio for every cache size, without one simulation per size. [4]
Limitations
- The d < C threshold is for exact LRU under the stated demand-cache assumptions, not every policy using a stack. LIRS requires its own state transitions; sharding, invalidation or admission changes also require a matching model. [1, 5]
Citations
- Ding and Zhong. Reuse Distance Analysis. UR-CS-TR-741, February 2001, sections 2.1-2.2 and Figures 1-3.
- Wires et al. Characterizing Storage Workloads with Counter Stacks. OSDI 2014, sections 2 and 3.2.
- Waldspurger et al. Efficient MRC Construction with SHARDS. FAST 2015, sections 2, 4.2 and 4.3.1-4.3.3; Figure 4.
- Jiang and Zhang. Making LRU Friendly to Weak Locality Workloads. IEEE TC 54(8), 939-952 (2005), sections 1.2, 3.3 and 4.
Further reading
Sources & caveats
- SHARDS sections 4.2 and 4.3.1-4.3.3 and Figure 4 checked 2026-11-01 for population, capacity-averaged error and original versus adjusted results.
- counter-stacks read 2026-10-23, sections 2 and 3.2, for the stack-position convention.
- A companion analysis with constructed traces is listed but not used in prose.