f048829d70
Adds a new custom attribute to the DIE of captured variables, containing the offset for the variable inside the closure struct. This can be used by debuggers to display the contents of a closure variable. Based on a sample program (delve) this increases the executable size by 0.06%. benchstat output: │ old.txt │ new.txt │ │ sec/op │ sec/op vs base │ Template 153.0m ± 6% 152.5m ± 14% ~ (p=0.684 n=10) Unicode 100.2m ± 15% 104.9m ± 7% ~ (p=0.247 n=10) GoTypes 943.6m ± 8% 986.2m ± 10% ~ (p=0.280 n=10) Compiler 97.79m ± 6% 101.63m ± 12% ~ (p=0.393 n=10) SSA 6.872 ± 37% 9.413 ± 106% ~ (p=0.190 n=10) Flate 128.0m ± 36% 125.0m ± 56% ~ (p=0.481 n=10) GoParser 214.9m ± 26% 201.4m ± 68% ~ (p=0.579 n=10) Reflect 452.6m ± 22% 412.2m ± 74% ~ (p=0.739 n=10) Tar 166.2m ± 27% 155.9m ± 73% ~ (p=0.393 n=10) XML 219.3m ± 24% 211.3m ± 76% ~ (p=0.739 n=10) LinkCompiler 523.2m ± 13% 513.5m ± 47% ~ (p=0.631 n=10) ExternalLinkCompiler 1.684 ± 2% 1.659 ± 25% ~ (p=0.218 n=10) LinkWithoutDebugCompiler 304.9m ± 12% 309.1m ± 7% ~ (p=0.631 n=10) StdCmd 70.76 ± 14% 68.66 ± 53% ~ (p=1.000 n=10) geomean 511.5m 515.4m +0.77% │ old.txt │ new.txt │ │ user-sec/op │ user-sec/op vs base │ Template 269.6m ± 13% 292.3m ± 17% ~ (p=0.393 n=10) Unicode 110.2m ± 8% 101.7m ± 18% ~ (p=0.247 n=10) GoTypes 2.181 ± 9% 2.356 ± 12% ~ (p=0.280 n=10) Compiler 119.1m ± 11% 121.9m ± 15% ~ (p=0.481 n=10) SSA 17.75 ± 52% 26.94 ± 123% ~ (p=0.190 n=10) Flate 256.2m ± 43% 226.8m ± 73% ~ (p=0.739 n=10) GoParser 427.0m ± 24% 422.3m ± 72% ~ (p=0.529 n=10) Reflect 990.5m ± 23% 905.5m ± 75% ~ (p=0.912 n=10) Tar 307.9m ± 27% 308.9m ± 64% ~ (p=0.393 n=10) XML 432.8m ± 24% 427.6m ± 89% ~ (p=0.796 n=10) LinkCompiler 796.9m ± 14% 800.4m ± 56% ~ (p=0.481 n=10) ExternalLinkCompiler 1.666 ± 4% 1.671 ± 28% ~ (p=0.971 n=10) LinkWithoutDebugCompiler 316.7m ± 12% 325.6m ± 8% ~ (p=0.579 n=10) geomean 579.5m 594.0m +2.51% │ old.txt │ new.txt │ │ text-bytes │ text-bytes vs base │ HelloSize 842.9Ki ± 0% 842.9Ki ± 0% ~ (p=1.000 n=10) ¹ CmdGoSize 10.95Mi ± 0% 10.95Mi ± 0% ~ (p=1.000 n=10) ¹ geomean 3.003Mi 3.003Mi +0.00% ¹ all samples are equal │ old.txt │ new.txt │ │ data-bytes │ data-bytes vs base │ HelloSize 15.08Ki ± 0% 15.08Ki ± 0% ~ (p=1.000 n=10) ¹ CmdGoSize 314.7Ki ± 0% 314.7Ki ± 0% ~ (p=1.000 n=10) ¹ geomean 68.88Ki 68.88Ki +0.00% ¹ all samples are equal │ old.txt │ new.txt │ │ bss-bytes │ bss-bytes vs base │ HelloSize 396.8Ki ± 0% 396.8Ki ± 0% ~ (p=1.000 n=10) ¹ CmdGoSize 428.8Ki ± 0% 428.8Ki ± 0% ~ (p=1.000 n=10) ¹ geomean 412.5Ki 412.5Ki +0.00% ¹ all samples are equal │ old.txt │ new.txt │ │ exe-bytes │ exe-bytes vs base │ HelloSize 1.310Mi ± 0% 1.310Mi ± 0% +0.02% (p=0.000 n=10) CmdGoSize 16.37Mi ± 0% 16.38Mi ± 0% +0.01% (p=0.000 n=10) geomean 4.631Mi 4.632Mi +0.02% Change-Id: Ib416ee2d916ec61ad4a5c26bab09597595f57e04 Reviewed-on: https://go-review.googlesource.com/c/go/+/563816 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> |
||
---|---|---|
.github | ||
api | ||
doc | ||
lib/time | ||
misc | ||
src | ||
test | ||
.gitattributes | ||
.gitignore | ||
codereview.cfg | ||
CONTRIBUTING.md | ||
go.env | ||
LICENSE | ||
PATENTS | ||
README.md | ||
SECURITY.md |
The Go Programming Language
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Gopher image by Renee French, licensed under Creative Commons 4.0 Attributions license.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
Download and Install
Binary Distributions
Official binary distributions are available at https://go.dev/dl/.
After downloading a binary release, visit https://go.dev/doc/install for installation instructions.
Install From Source
If a binary distribution is not available for your combination of operating system and architecture, visit https://go.dev/doc/install/source for source installation instructions.
Contributing
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines at https://go.dev/doc/contribute.
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://go.dev/wiki/Questions for a list of places to ask questions about the Go language.