Monthly Archives: September 2013

每个程序员都应该了解的延迟时间

L1 cache reference
L1 cache读取
0.5ns
Branch mispredict
分支误预测
5ns
L2 cache reference
L2 cache读取
7ns 14x L1 cache
Mutex lock/unlock
互斥锁
25ns
Main memory reference
主内存读取
100ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy
压缩1KB数据
3,000ns
Send 1K bytes over 1 Gbps network
在1Gbps网络上发送2K数据
10,000ns 0.01ms
Read 4K randomly from SSD*
从SSD硬盘随机读取4K数据*
150,000ns 0.15ms
Read 1 MB sequentially from memory
从内存连续读取1MB数据
250,000ns 0.25ms
Round trip within same datacenter
同一数据中心的往返时间(RTT)
500,000ns 0.5ms
Read 1 MB sequentially from SSD*
从SSD硬盘顺序读取1MB数据*
1,000,000ns 1ms 4x memory
Disk seek
磁盘寻道时间
10,000,000ns 10ms 20x datacenter roundtrip
Read 1 MB sequentially from Network
从网络上顺序读取1M数据
10,000,000ns 10ms
Read 1 MB sequentially from disk
从磁盘上顺序读取1M数据
20,000,000ns 20ms 80x memory, 20x SSD
Send packet CA->Netherlands->CA
发送一个包从从加州->荷兰->加州
150,000,000ns 150ms

 

* Assuming ~1GB/sec SSD

注:原文来自https://gist.github.com/jboner/2841832,略有修改

 


Data Warehouse For Ever原创文章,转载请注明出处