3
votes

I am running a micro-benchmark with JMH to evaluate the performance of different Java algorithm implementations. Yet, I observe inconsistent throughput depending on weather the Intel CPU turbo boost is running, or not. Since turbo boost is activated according to environment conditions, sometimes it is activated for some bench tests and not for others. Thus, some results show better throughput just because the turbo boost was activated and not because of its better efficiency.

So, I am trying to avoid the effects of turbo boost by annotating all my tests with @GroupThreads(threadsNumber) and a threadsNumber equals to the number of available processors and thus expect to run all processors in full charge and activate the turbo boost during entire benchmark execution.

Is this a right approach? Is there a more reliable alternative to avoid the effects of turbo boost?

Updated: according to @Andreas answer, an alternative approach is to turn turbo boost off in the BIOS, or in Operating System settings. However, since the CPU clock frequency may change I think that is not enough to turn it off, because the CPU speed variation will affect the benchmarks too. So, maybe it is more reliable to keep it on, force turbo boost to run and set all threads to the benchmark.

Which one would be the better approach to avoid the effects of turbo boost?

1

1 Answers

1
votes

To prevent Turbo Boost, turn it off in the BIOS, or in Operating System settings.

Google disable turbo boost for how, depending on your system.