现代CPU的每个刻度的缓存带宽

osg*_*sgx 15 cpu performance caching cpu-architecture cpu-cache

现代CPU的缓存访问速度是多少?Intel P4,Core2,Corei7,AMD每个处理器时钟周期内可以从内存中读取或写入多少字节?

请回答理论(ld/sd单位的宽度及其uOPs/tick的吞吐量)和实际数字(甚至是memcpy速度测试,或STREAM基准测试),如果有的话.

PS是问题,与汇编程序中的最大加载/存储指令率有关.可以有理论加载速率(所有每个Tick的指令都是最宽的负载),但是处理器只能给出部分这样的,一个实际的加载限制.

osg*_*sgx 8

对于nehalem:rolfed.com/nehalem/nehalemPaper.pdf

Each core in the architecture has a 128-bit write port and a
128-bit read port to the L1 cache. 
Run Code Online (Sandbox Code Playgroud)

128位= 16字节/时钟读取和128位= 16字节/时钟写入(我可以在单个周期中组合读取和写入吗?)

The L2 and L3 caches each have a 256-bit port for reading or writing, 
but the L3 cache must share its port with three other cores on the chip.
Run Code Online (Sandbox Code Playgroud)

可以在单个时钟中使用L2和L3读写端口吗?

Each integrated memory controller has a theoretical bandwidth
peak of 32 Gbps.
Run Code Online (Sandbox Code Playgroud)

延迟(时钟滴答),一些由CPU-Z的延迟工具或lmbench的lat_mem_rd测量 - 都使用长链表行走来正确测量现代无序核心,如英特尔酷睿i7

           L1     L2     L3, cycles;   mem             link
Core 2      3     15     --           66 ns           http://www.anandtech.com/show/2542/5
Core i7-xxx 4     11     39          40c+67ns         http://www.anandtech.com/show/2542/5
Itanium     1     5-6    12-17       130-1000 (cycles)
Itanium2    2     6-10   20          35c+160ns        http://www.7-cpu.com/cpu/Itanium2.html
AMD K8            12                 40-70c +64ns     http://www.anandtech.com/show/2139/3
Intel P4    2     19     43          200-210 (cycles) http://www.arsc.edu/files/arsc/phys693_lectures/Performance_I_Arch.pdf
AthlonXP 3k 3     20                 180 (cycles)     --//--
AthlonFX-51 3     13                 125 (cycles)     --//--
POWER4      4     12-20  ??          hundreds cycles  --//--
Haswell     4     11-12  36          36c+57ns         http://www.realworldtech.com/haswell-cpu/5/    
Run Code Online (Sandbox Code Playgroud)

延迟数据的良好来源是7cpu网站,例如Haswell:http://www.7-cpu.com/cpu/Haswell.html

有关lat_mem_rd程序的更多信息,请参见其手册页SO.

  • 回答你自己的问题?您仍然没有解释您尝试使用此信息实现的目标.如果你这样做,你可能会得到更好的答案. (3认同)

Pau*_*l R 7

最宽的读/写是128位(16字节)SSE加载/存储.L1/L2/L3高速缓存具有不同的带宽和延迟,这些当然是CPU特定的.现代CPU上典型的L1延迟为2-4个时钟,但每个时钟通常可以发出1或2个加载指令.

我怀疑这里潜藏着一个更具体的问题 - 你实际上想要实现的是什么?你只是想写尽可能快的memcpy吗?