You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.1 KiB

  1. // Copyright 2014 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. /*
  5. The benchcmp command displays performance changes between benchmarks.
  6. Benchcmp parses the output of two 'go test' benchmark runs,
  7. correlates the results per benchmark, and displays the deltas.
  8. To measure the performance impact of a change, use 'go test'
  9. to run benchmarks before and after the change:
  10. go test -run=NONE -bench=. ./... > old.txt
  11. # make changes
  12. go test -run=NONE -bench=. ./... > new.txt
  13. Then feed the benchmark results to benchcmp:
  14. benchcmp old.txt new.txt
  15. Benchcmp will summarize and display the performance changes,
  16. in a format like this:
  17. $ benchcmp old.txt new.txt
  18. benchmark old ns/op new ns/op delta
  19. BenchmarkConcat 523 68.6 -86.88%
  20. benchmark old allocs new allocs delta
  21. BenchmarkConcat 3 1 -66.67%
  22. benchmark old bytes new bytes delta
  23. BenchmarkConcat 80 48 -40.00%
  24. */
  25. package main // import "golang.org/x/tools/cmd/benchcmp"