Latency Numbers Every Engineer Must Know
PerformanceKnow the order-of-magnitude cost of every operation - from L1 cache to cross-continental packets.
If L1 cache access = 1 second (reading a note on your desk), then RAM access = 2 minutes (walking to a filing cabinet), SSD access = 3 days, spinning disk = 2 months, and a round-trip packet from New York to London = 2 days of flights but you're also flying at jet speed. This relative scale governs every performance decision.
These numbers are approximations (2020s hardware). The exact numbers matter less than knowing the RATIOS between them. The fact that disk is 1000x slower than RAM is architecturally meaningful.
L1 cache reference: ~0.5 ns. Nearly instantaneous.
Branch misprediction: ~5 ns.
L2 cache reference: ~7 ns. 14x slower than L1.
Mutex lock/unlock: ~25 ns.
Main memory (RAM) reference: ~100 ns. 200x slower than L1 cache.
Compress 1KB with Snappy: ~3,000 ns (3 µs).
Send 1KB over 1 Gbps network: ~10,000 ns (10 µs).
Read 4KB from SSD: ~150,000 ns (150 µs).
Read 1MB sequentially from RAM: ~250,000 ns (250 µs).
Round trip within same datacenter: ~500,000 ns (0.5 ms).
Read 1MB sequentially from SSD: ~1,000,000 ns (1 ms).
Disk seek (HDD): ~10,000,000 ns (10 ms).
Read 1MB sequentially from HDD: ~20,000,000 ns (20 ms).
Send packet from CA to Netherlands and back: ~150,000,000 ns (150 ms).
- RAM is 1,000x faster than disk. Put hot data in memory (Redis).
- SSD is 10-100x faster than spinning disk. Always use NVMe SSDs in production.
- Cross-datacenter round trips are ~1-5ms. Design your system to minimize them.
- Network within the same AZ is ~0.5ms. Cross-region is ~30-150ms.
- Memory bandwidth (RAM reads) is extremely fast - sequential reads are your friend.
Curated Curation & Deep Insights
ScaleDojo CertifiedOur system architects are vetting high-quality, authorized video guides for Latency Numbers Every Engineer Must Know with zero third-party platform links.
We are preparing premium, zero-competitor deep-dives for Latency Numbers Every Engineer Must Know. Authorized reading references will appear automatically.