case
10Sep/150

Latency numbers every programmer should know

L1 cache reference                            0.5 ns
Branch mispredict                             5   ns
L2 cache reference                            7   ns             14x L1 cache
Mutex lock/unlock                            25   ns
Main memory reference                       100   ns             20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy              3,000   ns
Send 1K bytes over 1 Gbps network        10,000   ns    0.01 ms
Read 4K randomly from SSD*              150,000   ns    0.15 ms
Read 1 MB sequentially from memory      250,000   ns    0.25 ms
Round trip within same datacenter       500,000   ns    0.5  ms
Read 1 MB sequentially from SSD*      1,000,000   ns    1    ms  4X memory
Disk seek                            10,000,000   ns   10    ms  20x datacenter roundtrip
Read 1 MB sequentially from disk     20,000,000   ns   20    ms  80x memory, 20X SSD
Send packet CA->Netherlands->CA     150,000,000   ns  150    ms

For perspective on the numbers consider L1 access = 1 scond

L1 cache reference                             0:00:01
Branch mispredict                              0:00:10
L2 cache reference                             0:00:14
Mutex lock/unlock                              0:00:50
Main memory reference                          0:03:20
Compress 1K bytes with Zippy                   1:40:00
Send 1K bytes over 1 Gbps network              5:33:20
Read 4K randomly from SSD             3 days, 11:20:00
Read 1 MB sequentially from memory    5 days, 18:53:20
Round trip within same datacenter    11 days, 13:46:40
Read 1 MB sequentially from SSD      23 days, 03:33:20
Disk seek                           231 days, 11:33:20
Read 1 MB sequentially from disk    462 days, 23:06:40
Send packet CA->Netherlands->CA    3472 days, 05:20:00
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


CommentLuv badge

*

No trackbacks yet.