Microbenchmarking is not something that every developer will have to worry about, but for those who do, there are several pitfalls that you should be aware of. In this section we will review the most common pitfalls and suggest strategies for avoiding them.
Techniques for avoiding microbenchmarking pitfalls
Power management
There are many subsystems that can be used to help you manage the balance between power and performance (that is, cpufreq). These systems can alter the state of time during benchmarks.
There are two suggested strategies for this pitfall:
- Disable any power management systems before running tests
- Run the benchmarks for longer periods