internal/telemetry: add fast non variadic event functions

This adds variants of the main event functions that take specific
numbers of tags, rather than a tag slice. This reduces the allocation
cost when using those functions with no exporter to zero.

name                old time/op    new time/op    delta
/Baseline-8            158ns ± 7%     154ns ± 1%      ~
/StdLog-8             6.90µs ± 1%    6.83µs ± 1%      ~
/LogNoExporter-8      1.78µs ± 5%    1.20µs ± 3%   -32.37%
/TraceNoExporter-8    3.11µs ± 3%    2.48µs ± 2%   -20.39%
/StatsNoExporter-8    3.18µs ± 5%    1.87µs ± 3%   -41.16%
/Log-8                46.8µs ± 2%    44.8µs ± 1%    -4.33%
/Trace-8              55.1µs ± 5%    54.3µs ± 3%      ~
/Stats-8              15.8µs ± 3%    13.4µs ± 1%   -15.00%

name                old alloc/op   new alloc/op   delta
/Baseline-8            0.00B          0.00B           ~
/StdLog-8               552B ± 0%      552B ± 0%      ~
/LogNoExporter-8      1.02kB ± 0%    0.00kB       -100.00%
/TraceNoExporter-8    1.54kB ± 0%    0.51kB ± 0%   -66.67%
/StatsNoExporter-8    2.05kB ± 0%    0.00kB       -100.00%
/Log-8                26.0kB ± 0%    24.0kB ± 0%    -7.87%
/Trace-8              28.7kB ± 0%    27.1kB ± 0%      ~
/Stats-8              13.3kB ± 0%    10.2kB ± 0%   -23.08%

name                old allocs/op  new allocs/op  delta
/Baseline-8             0.00           0.00           ~
/StdLog-8               30.0 ± 0%      30.0 ± 0%      ~
/LogNoExporter-8        16.0 ± 0%       0.0       -100.00%
/TraceNoExporter-8      32.0 ± 0%      16.0 ± 0%   -50.00%
/StatsNoExporter-8      32.0 ± 0%       0.0       -100.00%
/Log-8                   430 ± 0%       382 ± 0%   -11.16%
/Trace-8                 496 ± 0%       464 ± 0%    -6.45%
/Stats-8                 192 ± 0%       128 ± 0%   -33.33%

Change-Id: I629c0d506ab07de6f12b0acbecfc7407f59a4285
Reviewed-on: https://go-review.googlesource.com/c/tools/+/225580
Run-TryBot: Ian Cottrell <iancottrell@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Robert Findley <rfindley@google.com>
5 files changed
tree: be4cd6b9907c5df788e5acbf642773d8b77d7906
  1. benchmark/
  2. blog/
  3. cmd/
  4. container/
  5. cover/
  6. go/
  7. godoc/
  8. gopls/
  9. imports/
  10. internal/
  11. playground/
  12. present/
  13. refactor/
  14. txtar/
  15. .gitattributes
  16. .gitignore
  17. AUTHORS
  18. codereview.cfg
  19. CONTRIBUTING.md
  20. CONTRIBUTORS
  21. go.mod
  22. go.sum
  23. LICENSE
  24. PATENTS
  25. README.md
README.md

Go Tools

This subrepository holds the source for various packages and tools that support the Go programming language.

Some of the tools, godoc and vet for example, are included in binary Go distributions.

Others, including the Go guru and the test coverage tool, can be fetched with go get.

Packages include a type-checker for Go and an implementation of the Static Single Assignment form (SSA) representation for Go programs.

Download/Install

The easiest way to install is to run go get -u golang.org/x/tools/.... You can also manually git clone the repository to $GOPATH/src/golang.org/x/tools.

Report Issues / Send Patches

This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://golang.org/doc/contribute.html.

The main issue tracker for the tools repository is located at https://github.com/golang/go/issues. Prefix your issue with “x/tools/(your subdir):” in the subject line, so it is easy to find.