每个计算机工程师都应该知道的一组数字

2011-04-04 08:51:59 +08:00
 Livid
According to http://www.cs.cornell.edu/projects/ladis2009/talks/dean-keynote-ladis2009.pdf

• L1 cache reference: 0.5 ns
• Branch mispredict: 5 ns
• L2 cache reference: 7 ns
• Mutex lock/unlock: 100 ns
• Main memory reference: 100 ns
• Compress 1K bytes with Zippy: 10,000 ns
• Send 2K bytes over 1 Gbps network: 20,000 ns
• Read 1 MB sequentially from memory: 250,000 ns
• Round trip within same datacenter: 500,000 ns
• Disk seek: 10,000,000 ns
• Read 1 MB sequentially from network: 10,000,000 ns
• Read 1 MB sequentially from disk: 30,000,000 ns
• Send packet CA->Netherlands->CA: 150,000,000 ns
5931 次点击
所在节点    程序员
7 条回复
willwen
2011-04-04 09:58:54 +08:00
这可以用超频调。。取决于性能。。
Oliver
2011-04-04 10:59:11 +08:00
L1 Cache 的速度好快啊。寄存器的速度是否会更快,或者和 L1 Cache 持平?
stranbird
2011-04-04 11:22:15 +08:00
寄存是硬件实现 显然很快啊。 L1就是用寄存器们来实现的。
dogFish
2011-04-04 11:43:32 +08:00
@stranbird L1,L2,寄存器都是CPU内建存储, 没有谁实现谁一说吧
dogFish
2011-04-04 11:48:18 +08:00
@Oliver 至少持平吧, 我猜的:p
对于程序员,寄存器速度没有直接意义吧, 能减少缓存命中次数是最接近cpu的优化了吧
dogFish
2011-04-04 11:49:13 +08:00
错了, 是减少命中失败次数
Oliver
2011-04-04 11:53:23 +08:00
@dogFish 谢谢!

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/10956

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX