commit | cd2df34ff7e5aa78e2fea95e961a1d01771df384 | [log] [tgz] |
---|---|---|
author | Jonathan Amsterdam <jba@google.com> | Sun Jun 06 08:21:42 2021 -0400 |
committer | Jonathan Amsterdam <jba@google.com> | Mon Jun 07 18:20:18 2021 +0000 |
tree | a8da160bef8013dc018847a15181315910862d3e | |
parent | bacb2583bd66e4fd1907a1376f8c883bc31397c2 [diff] |
event: add benchmarks for context lookups See how much it costs to look up the exporter in the context. The results (see below) show that with a context chain of length 10, doing a context lookup is about 20% slower than not. go test -v -run XXX -bench BuildContext goos: linux goarch: amd64 pkg: golang.org/x/exp/event cpu: Intel(R) Xeon(R) CPU @ 2.30GHz BenchmarkBuildContext BenchmarkBuildContext/depth_1 BenchmarkBuildContext/depth_1/with BenchmarkBuildContext/depth_1/with-8 6222020 192.8 ns/op BenchmarkBuildContext/depth_1/without BenchmarkBuildContext/depth_1/without-8 5743065 182.9 ns/op BenchmarkBuildContext/depth_5 BenchmarkBuildContext/depth_5/with BenchmarkBuildContext/depth_5/with-8 6233917 184.8 ns/op BenchmarkBuildContext/depth_5/without BenchmarkBuildContext/depth_5/without-8 7289814 165.8 ns/op BenchmarkBuildContext/depth_7 BenchmarkBuildContext/depth_7/with BenchmarkBuildContext/depth_7/with-8 5941093 193.5 ns/op BenchmarkBuildContext/depth_7/without BenchmarkBuildContext/depth_7/without-8 7317411 167.6 ns/op BenchmarkBuildContext/depth_10 BenchmarkBuildContext/depth_10/with BenchmarkBuildContext/depth_10/with-8 5709080 207.0 ns/op BenchmarkBuildContext/depth_10/without BenchmarkBuildContext/depth_10/without-8 7281186 168.9 ns/op Change-Id: If38409916240dd15d4924505aa80f98c107830e4 Reviewed-on: https://go-review.googlesource.com/c/exp/+/325489 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> Reviewed-by: Ian Cottrell <iancottrell@google.com>
This subrepository holds experimental and deprecated (in the old
directory) packages.
The idea for this subrepository originated as the pkg/exp
directory of the main repository, but its presence there made it unavailable to users of the binary downloads of the Go installation. The subrepository has therefore been created to make it possible to go get
these packages.
Warning: Packages here are experimental and unreliable. Some may one day be promoted to the main repository or other subrepository, or they may be modified arbitrarily or even disappear altogether.
In short, code in this subrepository is not subject to the Go 1 compatibility promise. (No subrepo is, but the promise is even more likely to be violated by go.exp than the others.)
Caveat emptor.