您的位置:首页 > 其它

[转载]Latency Numbers Every Programmer Should Know

2013-01-18 13:58 351 查看
http://yaronspace.cn/blog/archives/1528
LatencyComparisonNumbers
--------------------------
L1cachereference0.5ns
Branchmispredict5ns
L2cachereference7ns14xL1cache
Mutexlock/unlock25ns
Mainmemoryreference100ns20xL2cache,200xL1cache
Compress1KbyteswithZippy3,000ns
Send1Kbytesover1Gbpsnetwork10,000ns0.01ms
Read4KrandomlyfromSSD*150,000ns0.15ms
Read1MBsequentiallyfrommemory250,000ns0.25ms
Roundtripwithinsamedatacenter500,000ns0.5ms
Read1MBsequentiallyfromSSD*1,000,000ns1ms4Xmemory
Diskseek10,000,000ns10ms20xdatacenterroundtrip
Read1MBsequentiallyfromdisk20,000,000ns20ms80xmemory,20XSSD
SendpacketCA->Netherlands->CA150,000,000ns150ms

Notes
-----
1ns=10-9seconds
1ms=10-3seconds
*Assuming~1GB/secSSD

Credit
------
ByJeffDean:http://research.google.com/people/jeff/OriginallybyPeterNorvig:http://norvig.com/21-days.html#answers
Contributions
-------------
Someupdatesfrom:https://gist.github.com/2843375Great'humanized'comparisonversion:https://gist.github.com/2843375Visualcomparisonchart:http://i.imgur.com/k0t1e.pngNiceanimatedpresentationofthedata:http://prezi.com/pdkvgys-r0y6/latency-numbers-for-programmers-web-development/

这里有一篇更详细,描述了各个年代相关模块的latency:
http://www.eecs.berkeley.edu/~rcs/research/interactive_latency.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: