Package driver provides common benchmarking logic shared between benchmarks.
A benchmark should call Main with a benchmark function. The benchmark function can do one of two things when invoked:
1. Do whatever it wants, fill and return Result object. 2. Call Benchmark helper function and provide benchmarking function func(N uint64), similar to standard testing benchmarks. The rest is handled by the driver.
Parallel is a public helper function that runs f N times in P*GOMAXPROCS goroutines.
Runs the cmd under perf. Returns filename of the profile. Any errors are ignored.
Size runs size command on the file. Returns filename with output. Any errors are ignored.
Result contains all the interesting data about benchmark execution.
Benchmark runs f several times, collects stats, and creates cpu/mem profiles.