1
0
mirror of https://github.com/golang/go synced 2024-09-29 01:24:34 -06:00
The Go programming language
Go to file
Cherry Mui 5497300d9c cmd/internal/obj: reduce allocations in object file writing
Some object file writer functions are structured like, having a
local variable, setting fields, then passing it to a Write method
which eventually calls io.Writer.Write. As the Write call is an
interface call it escapes the parameter, which in turn causes the
local variable to be heap allocated. To reduce allocation, use
pre-allocated scratch space instead.

Reduce number of allocations in the compiler:
name        old allocs/op     new allocs/op     delta
Template           679k ± 0%         644k ± 0%  -5.17%  (p=0.000 n=20+20)
Unicode            603k ± 0%         581k ± 0%  -3.67%  (p=0.000 n=20+20)
GoTypes           3.83M ± 0%        3.63M ± 0%  -5.30%  (p=0.000 n=20+20)
Compiler           353k ± 0%         342k ± 0%  -3.09%  (p=0.000 n=18+19)
SSA               31.4M ± 0%        30.4M ± 0%  -3.02%  (p=0.000 n=20+20)
Flate              397k ± 0%         373k ± 0%  -5.92%  (p=0.000 n=20+18)
GoParser           777k ± 0%         735k ± 0%  -5.37%  (p=0.000 n=20+20)
Reflect           2.07M ± 0%        1.90M ± 0%  -7.89%  (p=0.000 n=18+20)
Tar                605k ± 0%         568k ± 0%  -6.26%  (p=0.000 n=19+16)
XML                801k ± 0%         766k ± 0%  -4.36%  (p=0.000 n=20+20)
[Geo mean]        1.18M             1.12M       -5.02%

Change-Id: I9d02a72e459e645527196ac54b6ee643a5ea6bd3
Reviewed-on: https://go-review.googlesource.com/c/go/+/449637
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
2022-11-10 22:41:06 +00:00
.github .github: update issue label for pkgsite-removal 2022-09-07 16:00:20 +00:00
api net/http: add ResponseController and per-handler timeouts 2022-11-10 18:18:03 +00:00
doc doc/go1.20: add a release note for os/exec API changes 2022-11-09 22:04:07 +00:00
lib/time lib/time, time/tzdata: update to 2022b 2022-08-11 20:03:19 +00:00
misc misc/cgo/test: skip Test9400 on Alpine 2022-11-07 21:15:29 +00:00
src cmd/internal/obj: reduce allocations in object file writing 2022-11-10 22:41:06 +00:00
test cmd/compile: enable brachelim pass on loong64 2022-11-09 06:10:55 +00:00
.gitattributes
.gitignore internal/buildcfg: move build configuration out of cmd/internal/objabi 2021-04-16 19:20:53 +00:00
codereview.cfg codereview.cfg: add codereview.cfg for master branch 2021-02-19 18:44:53 +00:00
CONTRIBUTING.md
LICENSE
PATENTS
README.md README: update from CC-BY-3.0 to CC-BY-4.0 2022-11-02 20:14:56 +00:00
SECURITY.md SECURITY.md: replace golang.org with go.dev 2022-04-26 19:59:47 +00:00

The Go Programming Language

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.

Gopher image 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.