为什么英特尔 SpeedStep 会影响执行周期数?
Why does Intel SpeedStep influence the number of cycles for execution?
我目前正在测量一段要执行的 C 代码的循环计数。该代码每 10 毫秒在 Windows API 的 _beginthreadex() 生成的额外线程中执行。周期测量是用 QueryThreadCycleTimes() 进行的,以避免计算中断或其他东西的滴答声。
当我在我的机器上单独执行这段代码时,循环计数在 550 000 和 1 800 000 之间变化,每次调用几次 (5-10) 之后。
经过一些研究,我发现在关闭 Intel SpeedStep 的情况下,循环计数的中位数为 580 000,偏差约为 10 000 个滴答。可以接受!
所以我现在的问题是,SpeedStep 如何影响执行所需的周期数。正如我所想,它只是通过降低功耗来降低处理器的频率,这应该不会影响循环计数,但是达到这个循环计数所需的时间?也许有人知道是否对其他重要硬件部件或 CPU 缓存有影响?
提前谢谢你。问候
萨沙
系统属性:
英特尔至强 E5 - 1620 处理器
Visual Studio 2013
QueryThreadCycleTime 函数manual page 声明:
This function uses timer services provided by the CPU, which can vary in implementation. For example, some CPUs will vary the frequency of the timer when changing the frequency at which the CPU runs and others will leave it at a fixed rate. The behavior of each CPU is described in the documentation provided by the CPU vendor.
我试图找到有关英特尔至强处理器如何工作的信息,但我的搜索业力与我无关。
我目前正在测量一段要执行的 C 代码的循环计数。该代码每 10 毫秒在 Windows API 的 _beginthreadex() 生成的额外线程中执行。周期测量是用 QueryThreadCycleTimes() 进行的,以避免计算中断或其他东西的滴答声。
当我在我的机器上单独执行这段代码时,循环计数在 550 000 和 1 800 000 之间变化,每次调用几次 (5-10) 之后。
经过一些研究,我发现在关闭 Intel SpeedStep 的情况下,循环计数的中位数为 580 000,偏差约为 10 000 个滴答。可以接受! 所以我现在的问题是,SpeedStep 如何影响执行所需的周期数。正如我所想,它只是通过降低功耗来降低处理器的频率,这应该不会影响循环计数,但是达到这个循环计数所需的时间?也许有人知道是否对其他重要硬件部件或 CPU 缓存有影响?
提前谢谢你。问候 萨沙
系统属性:
英特尔至强 E5 - 1620 处理器
Visual Studio 2013
QueryThreadCycleTime 函数manual page 声明:
This function uses timer services provided by the CPU, which can vary in implementation. For example, some CPUs will vary the frequency of the timer when changing the frequency at which the CPU runs and others will leave it at a fixed rate. The behavior of each CPU is described in the documentation provided by the CPU vendor.
我试图找到有关英特尔至强处理器如何工作的信息,但我的搜索业力与我无关。