18395615f2
TagOfString() deconstructs a string into length and data pointer using the unsafe package, and then stores the length into Tag.packed and the pointer into Tag.untyped, which it can do without allocations. Tag.UnpackString can reconstruct a string on access also using the unsafe package to rebuild the string header. This makes tag significantly smaller, which in turn makes things a faster name old time/op new time/op delta /Baseline-8 160ns ± 6% 158ns ± 8% ~ /StdLog-8 7.50µs ± 8% 7.47µs ±20% ~ /LogNoExporter-8 1.13µs ± 7% 1.04µs ± 2% -8.08% /TraceNoExporter-8 3.61µs ±15% 2.96µs ± 5% -18.08% /StatsNoExporter-8 1.65µs ± 7% 1.39µs ± 7% -16.14% /LogNoop-8 4.43µs ±14% 4.05µs ± 7% ~ /TraceNoop-8 10.9µs ± 5% 10.1µs ± 8% ~ /StatsNoop-8 8.08µs ± 3% 7.42µs ±13% ~ /Log-8 16.2µs ±14% 13.4µs ± 3% -17.10% /Trace-8 61.7µs ±22% 53.6µs ± 7% ~ /Stats-8 11.3µs ±10% 9.5µs ± 4% -15.56% name old alloc/op new alloc/op delta /Baseline-8 0.00B 0.00B ~ /StdLog-8 552B ± 0% 552B ± 0% ~ /LogNoExporter-8 0.00B 0.00B ~ /TraceNoExporter-8 3.58kB ± 0% 2.82kB ± 0% -21.43% /StatsNoExporter-8 0.00B 0.00B ~ /LogNoop-8 3.58kB ± 0% 2.82kB ± 0% -21.43% /TraceNoop-8 11.5kB ± 0% 9.2kB ± 0% -20.00% /StatsNoop-8 7.17kB ± 0% 5.63kB ± 0% -21.43% /Log-8 3.58kB ± 0% 2.82kB ± 0% -21.43% /Trace-8 27.9kB ± 0% 23.6kB ± 0% -15.60% /Stats-8 7.17kB ± 0% 5.63kB ± 0% -21.43% name old allocs/op new allocs/op delta /Baseline-8 0.00 0.00 ~ /StdLog-8 30.0 ± 0% 30.0 ± 0% ~ /LogNoExporter-8 0.00 0.00 ~ /TraceNoExporter-8 16.0 ± 0% 16.0 ± 0% ~ /StatsNoExporter-8 0.00 0.00 ~ /LogNoop-8 16.0 ± 0% 16.0 ± 0% ~ /TraceNoop-8 64.0 ± 0% 64.0 ± 0% ~ /StatsNoop-8 32.0 ± 0% 32.0 ± 0% ~ /Log-8 16.0 ± 0% 16.0 ± 0% ~ /Trace-8 384 ± 0% 384 ± 0% ~ /Stats-8 32.0 ± 0% 32.0 ± 0% ~ Change-Id: If5c369f138b60435f1aa74120aa3c1b68baae402 Reviewed-on: https://go-review.googlesource.com/c/tools/+/228234 Run-TryBot: Ian Cottrell <iancottrell@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com> |
||
---|---|---|
benchmark/parse | ||
blog | ||
cmd | ||
container/intsets | ||
cover | ||
go | ||
godoc | ||
gopls | ||
imports | ||
internal | ||
playground | ||
present | ||
refactor | ||
txtar | ||
.gitattributes | ||
.gitignore | ||
AUTHORS | ||
codereview.cfg | ||
CONTRIBUTING.md | ||
CONTRIBUTORS | ||
go.mod | ||
go.sum | ||
LICENSE | ||
PATENTS | ||
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.