Documentation ¶
Overview ¶
benchplot interactively fits and displays a least squares fit on groups of parameterized benchmarks.
Usage:
benchplot [options] bench1.txt [bench2.txt ...]
The input bench.txt file(s) should contain the output of a number of runs of “go test -bench.” Benchmarks that match the regexp in the “vars” flag will be collected into a sample for fitting a least squares regression.
Example ¶
Suppose we collect benchmark results from running “go test -bench=Sort” on this package.
The file bench.txt contains:
PASS BenchmarkSort10-4 1000000 1008 ns/op BenchmarkSort100-4 200000 8224 ns/op BenchmarkSort1000-4 10000 152945 ns/op BenchmarkSort10000-4 1000 1950999 ns/op BenchmarkSort100000-4 50 25081946 ns/op BenchmarkSort1000000-4 5 302228845 ns/op BenchmarkSort10000000-4 1 3631295293 ns/op BenchmarkStableSort10-4 1000000 1260 ns/op BenchmarkStableSort100-4 100000 16730 ns/op BenchmarkStableSort1000-4 5000 362024 ns/op BenchmarkStableSort10000-4 300 5731738 ns/op BenchmarkStableSort100000-4 20 88171712 ns/op BenchmarkStableSort1000000-4 1 1205361782 ns/op BenchmarkStableSort10000000-4 1 14349613704 ns/op ok github.com/jonlawlor/benchplot 138.860s
In these benchmarks, the suffix 10 .. 10000000 indicates how many items are sorted in the benchmark. benchplot can estimate and interactively visualize the relationship between the number of elements to sort and how long it takes to perform the sort.
Options are:
-http=addr HTTP service address (e.g., '127.0.0.1:6060' or just ':6060')