Cache Latency Calculator (Average Memory Access Time)
Average access time of a cache or any fast-store-in-front-of-a-slow-one from the hit rate, hit time and miss penalty, and the speed-up it gives.
Results
The dashed line marks the value you entered.
What this tool does
The textbook formula is AMAT = hit time + miss rate × miss penalty, and it is dominated by the misses: with a 1 ns hit and a 100 ns penalty, moving from 95 % to 99 % hits cuts the average from 6 ns to 2 ns, a threefold gain from four points. That is why a hit rate that looks excellent can still leave a slow system, and why the penalty matters as much as the rate. The same formula applies to a CPU cache, a database cache or a CDN, and it nests: the miss penalty of one level is the average access time of the next.
Formula
AMAT = hit time + miss rate × miss penalty (= h × t_hit + (1 − h) × t_miss, with t_miss = hit time + penalty)
Variables
| Symbol | Meaning | Unit |
|---|---|---|
h | Cache hit rate | % |
th | Time for a hit | ns |
mp | Miss penalty (extra time to fetch from memory) | ns |
AM | Average access time (AMAT) | ns |
MR | Miss rate | % |
NC | Access time without a cache | ns |
SP | Speed-up from the cache | × |
Worked example
- Cache hit rate95 %
- Time for a hit1 ns
- Miss penalty (extra time to fetch from memory)100 ns
- Average access time (AMAT)6.00 ns
- Miss rate5.00 %
- Access time without a cache101.00 ns
- Speed-up from the cache16.83 ×
Limitations
- The formula assumes ideal conditions: no friction losses, no air resistance and no efficiency losses unless you enter them.
- The result is an estimate based only on the values you type. Real situations often include factors this calculator does not know about.