Paritian

Developers

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

Average access time (AMAT) 6.00 ns
Miss rate 5.00 %
Access time without a cache 101.00 ns
Speed-up from the cache 16.83 ×
How it changes
Average access time (AMAT)Cache hit rate 50 – 100. Average access time (AMAT): 51 → 1Average access time (AMAT)02040605060708090100Cache hit rate (%)

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

SymbolMeaningUnit
hCache hit rate%
thTime for a hitns
mpMiss penalty (extra time to fetch from memory)ns
AMAverage access time (AMAT)ns
MRMiss rate%
NCAccess time without a cachens
SPSpeed-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.