import "golang.org/x/benchmarks/driver"
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.
driver.go driver_go12.go driver_go15.go driver_linux.go driver_unix.go
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.
type Result struct { N uint64 // number of iterations Duration time.Duration // total run duration RunTime uint64 // ns/op Metrics map[string]uint64 Files map[string]string }
Result contains all the interesting data about benchmark execution.
Benchmark runs f several times, collects stats, and creates cpu/mem profiles.
Package driver imports 23 packages (graph) and is imported by 8 packages. Updated 2019-11-29. Refresh now. Tools for package owners.