Exactly how “fast” are modern CPUs?

后端 未结 15 2032
深忆病人
深忆病人 2020-12-23 22:41

When I used to program embedded systems and early 8/16-bit PCs (6502, 68K, 8086) I had a pretty good handle on exacly how long (in nanoseconds or microseconds) each instruct

15条回答
  •  南笙
    南笙 (楼主)
    2020-12-23 23:27

    As Doug already noted, the best case is zero (superscalar processor, multiple execution units, data already in L1 cache).

    The worst case is up to several miliseconds (when the OS handles a pagefault and has to fetch the data/instruction from the disk). Excluding disk/swapping it still depends on whether you have a NUMA machine, which kind of topology it has, in which memory node the data lies, whether there is concurrent access from another CPU (bus locking and cache synchronization protocols), etc.

提交回复
热议问题