Repository: go
Issue: x/perf/benchstat: Allow for hardcoded old/new name in header to be configured
Labels: NeedsInvestigation,FeatureRequest

## Feature Request

<!--
Please answer these questions before submitting your issue. Thanks!
For questions please use one of our forums: https://github.com/golang/go/wiki/Questions
-->

### What version of Go are you using (`go version`)?

<pre>
$ go version
go version go1.17 darwin/amd64
</pre>

### Does this issue reproduce with the latest release?

Yes

### What operating system and processor architecture are you using (`go env`)?

<details><summary><code>go env</code> Output</summary><br><pre>
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/abhijeetprasad/Library/Caches/go-build"
GOENV="/Users/abhijeetprasad/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/abhijeetprasad/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/abhijeetprasad/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.17/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.17/libexec/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.17"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/abhijeetprasad/workspace/sentry-sdk-benchmark/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/_9/43498gx91ml4f25m1kt2r3jh0000gn/T/go-build1057351747=/tmp/go-build -gno-record-gcc-switches -fno-common"
</pre></details>

### What did you do?

<!--
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
-->

I'm using the benchstat library to aggregate some statistics, and then displaying the results in text format. In the library, the values of `old` and `new` are hardcoded to show up when you run `benchstat` on two configs: https://github.com/golang/perf/blob/master/benchstat/text.go#L208.

```
name            old ms      new ms       delta
LatenciesMean    9.00 ± 0%   10.75 ±12%  +19.44%  (p=0.029 n=4+4)
Latencies50th    9.00 ± 0%   10.00 ± 0%  +11.11%  (p=0.029 n=4+4)
Latencies90th    10.2 ± 7%    12.2 ± 6%  +19.51%  (p=0.029 n=4+4)
```

### What did you expect to see?

Is it possible for these values to be configured so that we display the name instead of `old` and `new`? Like the behaviour for running benchstat on 3+ configs as per: https://github.com/golang/perf/blob/master/benchstat/text.go#L210-L212.

Something like:

```
name  \ ms      baseline   instrumented  delta
LatenciesMean    9.00 ± 0%   10.75 ±12%  +19.44%  (p=0.029 n=4+4)
Latencies50th    9.00 ± 0%   10.00 ± 0%  +11.11%  (p=0.029 n=4+4)
Latencies90th    10.2 ± 7%    12.2 ± 6%  +19.51%  (p=0.029 n=4+4)
```

would be nice.

I wouldn't mind helping patch this if someone points me in the right direction. Thanks!