There are two performance testing frameworks can help you.
- SkyPat (https://skypat.skymizer.com)
- Hayai (https://github.com/nickbruun/hayai)
Both of them are inspired by Google Test framework and provide interface to support performance testing, so it’s easy to transport your original googletest to Hayai or SkyPat.
SkyPat combines unit tests and perf_evnet. It extends the concept of Google Test and provides an interface to access PMU. perf_event gives SkyPat accurate cycle counts that are useful for tools that are sensitive to the variance of timing, such as compilers. SkyPat can also profile a piece of code by PMU events (eq: cycles, instructions, cache reference, cache miss, etc.).
Hayai supports several performance measuring methods of different OS (Windows: QueryPerformanceCounter()
, Linux: gethrtime()
, Apple(OSX, iOS): mach_absolute_time()
) into its performance testing framework.