Computing & Software
Set-Associative LRU Cache Trace Calculator
Simulate read hits and misses for a bounded byte-address trace under least-recently-used replacement.
How the calculation works
Trace accesses = count(addresses) accesses. Cache hits = cache_trace_hits(addresses,capacity,line,ways) hits. Cache misses = count(addresses)-cache_trace_hits(addresses,capacity,line,ways) misses. Miss percentage = (1-cache_trace_hits(addresses,capacity,line,ways)/count(addresses))*100 %.
Worked example
Example inputs — Nonnegative whole byte addresses in access order: 0, 64, 0, 128, 0; Cache data bytes: 128; Bytes per cache line: 64; Ways per set: 1. Expected results — Trace accesses: 5 accesses; Cache hits: 1 hits; Cache misses: 4 misses; Miss percentage: 80 %.
Assumptions and limits
Analytical software/hardware scenario, not a benchmark or a live provider quote. Use the actual architecture, workload and billing definitions; overheads not named in the model are excluded. Initially empty cache, read-only accesses and true LRU within each set. Address translation, prefetching, dirty writebacks, coherence and multilevel effects are excluded. Capacity must contain whole sets.
Reference and further reading
Read the underlying subject reference. Calculith is an independent implementation; the reference does not endorse or certify this tool.
Related calculators
- Password Entropy & Brute-Force Time Estimate
- CPU Instruction Count & CPI Runtime Calculator
- Amdahl & Gustafson Parallel Speedup Calculator
- Roofline Arithmetic Intensity Performance Calculator
- Memory Bus Theoretical Bandwidth Calculator
Example values are editable. Results are estimates where assumptions apply. Calculations run in your browser. Updated 2026-11-16.