Microbenchmarks

EPICSv4 Workshop, SLS, 2013
pvMicroBenchmark
Matej Sekoranja
2
Goal – Microbenchmarking
 Time the entire process-chain (pipeline) of particular
action at of it’s points
 Generate nice reports
3
Existing tools
 Quite some good and useful C++ profilers that are able
to profile time … down to cache misses
 Could be used (with help of additional processing) to
microbenchmark single-threaded pipelines
 They affect performance!
 Roll our own…
4
Prototype
 A simple and tiny piece of code
 Fresh… hot code… from 1AM today
 Use of macros so that compiled release code contains no
signs of mirobenchmarking code overhead
 Need to add a line at points to be timed, e.g.
MB_POINT(testName, passId, stageNumber)
 Optimized for low overhead (~60ns per call above), threadsafe but no-locking used (now only works on Mac OS X +
GCC compiler)
5
Prototype (cntd.)
 ns resolution (depends on the time given from OS)
 Output result is a CSV file per test
1,0,32742196024467
1,1,32742196106999
1,2,32742196109184
1,3,32742196293204
 Simple, easy process (Unix command-line, Excel, …)
 Can be merged to allow inspecting pipeline spanning on
different processes and even hosts (with help of proper
clock synchronization)
6
THANK YOU!