1
0
mirror of https://github.com/golang/go synced 2024-10-01 08:28:43 -06:00
Commit Graph

11 Commits

Author SHA1 Message Date
Dominik Honnef
9f20d8c198 benchmark/parser, cmd/benchcmp: improve names of exported identifiers
Most of the names have been brought in line with the names used in
testing/BenchmarkResult. For example, NsOp becomes NsPerOp.

Additionally, "Bench" becomes "Benchmark" and "BenchSet" becomes "Set".

Change-Id: I7dfca68a804e285a87ab9692b5bb99ccb676da7f
Reviewed-on: https://go-review.googlesource.com/2610
Reviewed-by: Rob Pike <r@golang.org>
2015-01-15 01:28:17 +00:00
Tw
230eaff9cf cmd/benchcmp: close file when parse done
prevent file descriptor leak

Signed-off-by: Tw <tw19881113@gmail.com>

Change-Id: Ia1cacb3a287477b1f9b50fae248b5c34156c9557
Reviewed-on: https://go-review.googlesource.com/2740
Reviewed-by: Rob Pike <r@golang.org>
2015-01-13 09:03:36 +00:00
Dominik Honnef
0ff6678340 benchmark/parse, cmd/benchcmp: new package for parsing benchmarks
Move the parser for benchmark output from cmd/benchcmp into its own
package, benchmark/parse.

The majority of the change is just moving code around. Instead of
implementing the '-best' flag in ParseBenchSet, it is now implemented in
its own function 'selectBest' in cmd/benchcmp.

Bench.Ord (the ordinal position of a Bench within a BenchSet) has been
exported.

Change-Id: Id27032a220f9ff2596117b58b86243998695a804
Reviewed-on: https://go-review.googlesource.com/2102
Reviewed-by: Rob Pike <r@golang.org>
2015-01-06 01:34:08 +00:00
David Symonds
24257c8cd2 tools: add import comments.
Change-Id: Idda6e64580432cb9a731e4ebf4005ee4ceb4202d
Reviewed-on: https://go-review.googlesource.com/1244
Reviewed-by: Andrew Gerrand <adg@golang.org>
2014-12-09 22:42:16 +00:00
David Symonds
105b764ad0 benchcmp: Fix invocation instructions.
`go test` takes -run and -bench; the -test.run and -test.bench flags
are only for the test binary itself.

LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/113390043
2014-07-22 17:50:39 +10:00
Josh Bleecher Snyder
3e7bc48329 go.tools/cmd/benchcmp: do not generate trailing whitespace
text/tabwriter cells are tab-terminated, not tab-separated. This creates trailing whitespace. However, with left-aligned columns, it is ok not to treat the final element as a cell. Demo: http://play.golang.org/p/m_ajG8SSZe

LGTM=gri
R=golang-codereviews, gobot, gri
CC=golang-codereviews, r
https://golang.org/cl/103650043
2014-07-07 11:55:26 -07:00
Russ Cox
222283a9c8 go.tools/cmd/benchcmp: add -best flag
If you have multiple runs in old.txt and new.txt
the default behavior is to match them up pairwise
and compare successive pairs (and if you have a
different number of runs in each file, benchcmp
refuses to do anything).

The new -best flag changes the behavior to instead
compare the fastest run of each benchmark from
the two files. This makes sense if you believe that
the fastest speed is the 'actual' speed and the slower
results are due to the computer spending time doing
non-benchmark work while the benchmark was
running.

LGTM=josharian
R=golang-codereviews, josharian
CC=golang-codereviews
https://golang.org/cl/102890047
2014-05-30 21:45:27 -04:00
Robert Griesemer
30b1abe2f7 go.tools: fix various typos
LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/97920045
2014-05-02 14:38:08 -07:00
Josh Bleecher Snyder
6157b5a256 go.tools/cmd/benchcmp: expand documentation
LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/85390044
2014-04-14 17:00:04 -07:00
Josh Bleecher Snyder
e8c291b808 go.tools/cmd/benchcmp: sort by original benchmark order by default
benchcmp now preserves benchmark order. This restores the original
misc/benchcmp behavior. This also makes the output of benchcmp stable,
and groups together multiple -cpu results.

Magnitude-based sorting is still available via the -mag flag.
It is useful for surfacing items of note (particularly changes
in allocs) when making compiler changes and running broad
benchmarks.

Fixes golang/go#7259.

LGTM=dave
R=dave, mtj
CC=bradfitz, dvyukov, golang-codereviews
https://golang.org/cl/60840045
2014-02-19 07:44:49 -08:00
Josh Bleecher Snyder
285f6fe2f6 go.tools/cmd/benchcmp: add benchcmp
This is intended to replace the awk-based misc/benchcmp.
It mostly matches the existing misc/benchcmp.
Notable changes:

* Written in Go.
* Minor whitespace changes in the output; the tabular nature of the
  output is preserved, as is most number formatting and verbiage.
* Comparisons within each section are sorted from highest change to lowest.
* Proper handling of multiple benchmarks with the same name (issue 7016).
* Does not omit benchmark comparisons for which the new value is zero.
* Adds -changed flag to only show benchmarks whose value have changed.
  Useful for memory-oriented, large-scale benchmark comparisons.
* Has tests.
* Formats small ns measurements with extra precision.

Updates golang/go#7016.

LGTM=r
R=golang-codereviews, dave, dvyukov, oleku.konko, bradfitz, gobot, r
CC=golang-codereviews
https://golang.org/cl/47980043
2014-01-31 15:39:59 -08:00