Techniques for avoiding microbenchmarking pitfalls
Microbenchmarking is not something that every developer will have to worry about, but for those that 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.
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 to this pitfall:
- Disable any power management systems before running tests
- Run the benchmarks for longer periods
OS schedulers
Operating system schedulers, such as Solaris schedulers, help determine which software processes gain access to a system's resources. Use of these schedulers can result in unreliable benchmarking results.
There are two suggested strategies to this pitfall:
- Refine your system scheduling policies
- Run the benchmarks for longer periods