import "golang.org/x/benchmarks/driver"
Driver contains common benchmarking logic shared between benchmarks. It defines the main function which calls one of the benchmarks registered with Register function. When a benchmark is invoked it has 2 choices:
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
func Main()
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, chooses the best run and creates cpu/mem profiles.
Package driver imports 22 packages (graph) and is imported by 5 packages. Updated 2 months ago. Refresh now. Tools for package owners.