本文介绍了从内存中提取一个单词需要多长时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据 Peter Norvig 的建议,我正在思考这个问题:

Taking Peter Norvig's advice, I am pondering on the question:

从内存中获取一个单词需要多长时间,无论是否发生缓存未命中?

(假设标准硬件和架构.为了简化计算,假设时钟为 1Ghz)

(Assume standard hardware and architecture. To simplify calculations assume 1Ghz clock)

推荐答案

看起来像 Norvig 自己回答这个问题:

Seems like Norvig answers this himself:

execute typical instruction         1/1,000,000,000 sec = 1 nanosec
fetch from L1 cache memory          0.5 nanosec
branch misprediction                5 nanosec
fetch from L2 cache memory          7 nanosec
Mutex lock/unlock                   25 nanosec
fetch from main memory              100 nanosec
send 2K bytes over 1Gbps network    20,000 nanosec
read 1MB sequentially from memory   250,000 nanosec
fetch from new disk location (seek) 8,000,000 nanosec
read 1MB sequentially from disk     20,000,000 nanosec
send packet US to Europe and back   150 milliseconds = 150,000,000 nanosec 

执行典型指令"= 1 ns 的部分意味着 1 GHz CPU(当然,假设是高效的流水线).

The part where it says "execute typical instruction" = 1 ns implies a 1 GHz CPU (assuming efficient pipelining, of course).

我不知道他从哪里获取这些信息,但我相信 Peter Norvig 是可靠的 :-)

I don't know where he takes this information, but I trust Peter Norvig to be reliable :-)

这篇关于从内存中提取一个单词需要多长时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-17 16:08