Latency Comparison Numbers

January 31, 2017 · View on GitHub

Note: "Forked" from Latency Numbers Every Programmer Should Know

EventNanosecondsMicrosecondsMillisecondsComparison
L1 cache reference0.5---
Branch mispredict5.0---
L2 cache reference7.0--14x L1 cache
Mutex lock/unlock25.0---
Main memory reference100.0--20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy3,000.03--
Send 1K bytes over 1 Gbps network10,000.010--
Read 4K randomly from SSD150,000.0150-~1GB/sec SSD
Read 1 MB sequentially from memory250,000.0250--
Round trip within same datacenter500,000.0500--
Read 1 MB sequentially from SSD1,000,000.01,0001~1GB/sec SSD, 4X memory
Disk seek10,000,000.010,0001020x datacenter roundtrip
Read 1 MB sequentially from disk20,000,000.020,0002080x memory, 20X SSD
Send packet CA → Netherlands → CA150,000,000.0150,000150-

Unit Reference

  • 1 ns = 10^-9 seconds
  • 1 µs = 10^-6 seconds = 1,000 ns
  • 1 ms = 10^-3 seconds = 1,000 µs = 1,000,000 ns

Credit/Notes

Visual Comparison Charts

Visual Comparison Chart

Scale of Computing Latencies