GoPLS Viewer

Home|gopls/cmd/benchcmp/doc.go
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/*
6Deprecated: benchcmp is deprecated in favor of benchstat: golang.org/x/perf/cmd/benchstat
7
8The benchcmp command displays performance changes between benchmarks.
9
10Benchcmp parses the output of two 'go test' benchmark runs,
11correlates the results per benchmark, and displays the deltas.
12
13To measure the performance impact of a change, use 'go test'
14to run benchmarks before and after the change:
15
16    go test -run=NONE -bench=. ./... > old.txt
17    # make changes
18    go test -run=NONE -bench=. ./... > new.txt
19
20Then feed the benchmark results to benchcmp:
21
22    benchcmp old.txt new.txt
23
24Benchcmp will summarize and display the performance changes,
25in a format like this:
26
27    $ benchcmp old.txt new.txt
28    benchmark           old ns/op     new ns/op     delta
29    BenchmarkConcat     523           68.6          -86.88%
30
31    benchmark           old allocs     new allocs     delta
32    BenchmarkConcat     3              1              -66.67%
33
34    benchmark           old bytes     new bytes     delta
35    BenchmarkConcat     80            48            -40.00%
36*/
37package main // import "golang.org/x/tools/cmd/benchcmp"
38
MembersX
Members
X