efc47819c0
CL 38147 eliminated package gc globals in formatting routines. However, tconv still used the Type field Trecur to avoid infinite recursion when formatting recursive interfaces types such as (test/fixedbugs398.go): type i1 interface { F() interface { i1 } } type i2 interface { F() interface { i2 } } This CL changes the recursion prevention to use a parameter, and threads it through the formatting routines. Because this fundamentally limits the embedding depth of all types, it sets the depth limit to be much higher. In practice, it is unlikely to impact any code at all, one way or the other. The remaining uses of Type.Trecur are boolean in nature. A future CL will change Type.Trecur to be a boolean flag. The removal of a couple of mode.Sprintf calls makes this a very minor net performance improvement: name old alloc/op new alloc/op delta Template 40.0MB ± 0% 40.0MB ± 0% -0.13% (p=0.032 n=5+5) Unicode 30.0MB ± 0% 29.9MB ± 0% ~ (p=0.310 n=5+5) GoTypes 114MB ± 0% 113MB ± 0% -0.25% (p=0.008 n=5+5) SSA 856MB ± 0% 855MB ± 0% -0.04% (p=0.008 n=5+5) Flate 25.5MB ± 0% 25.4MB ± 0% -0.27% (p=0.008 n=5+5) GoParser 31.9MB ± 0% 31.9MB ± 0% ~ (p=0.222 n=5+5) Reflect 79.0MB ± 0% 78.6MB ± 0% -0.45% (p=0.008 n=5+5) Tar 26.8MB ± 0% 26.7MB ± 0% -0.25% (p=0.032 n=5+5) XML 42.4MB ± 0% 42.4MB ± 0% ~ (p=0.151 n=5+5) name old allocs/op new allocs/op delta Template 395k ± 0% 391k ± 0% -1.00% (p=0.008 n=5+5) Unicode 321k ± 1% 319k ± 0% -0.56% (p=0.008 n=5+5) GoTypes 1.16M ± 0% 1.14M ± 0% -1.61% (p=0.008 n=5+5) SSA 7.63M ± 0% 7.60M ± 0% -0.30% (p=0.008 n=5+5) Flate 239k ± 0% 234k ± 0% -1.94% (p=0.008 n=5+5) GoParser 320k ± 0% 317k ± 1% -0.86% (p=0.008 n=5+5) Reflect 1.00M ± 0% 0.98M ± 0% -2.17% (p=0.016 n=4+5) Tar 255k ± 1% 251k ± 0% -1.35% (p=0.008 n=5+5) XML 398k ± 0% 395k ± 0% -0.89% (p=0.008 n=5+5) Updates #15756 Change-Id: Id23e647d347aa841f9a69d51f7d2d7d27b259239 Reviewed-on: https://go-review.googlesource.com/38797 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org> |
||
---|---|---|
.github | ||
api | ||
doc | ||
lib/time | ||
misc | ||
src | ||
test | ||
.gitattributes | ||
.gitignore | ||
AUTHORS | ||
CONTRIBUTING.md | ||
CONTRIBUTORS | ||
favicon.ico | ||
LICENSE | ||
PATENTS | ||
README.md | ||
robots.txt |
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 3.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://golang.org/dl/.
After downloading a binary release, visit https://golang.org/doc/install or load doc/install.html in your web browser for installation instructions.
Install From Source
If a binary distribution is not available for your combination of operating system and architecture, visit https://golang.org/doc/install/source or load doc/install-source.html in your web browser for source installation instructions.
Contributing
Go is the work of hundreds of contributors. We appreciate your help!
To contribute, please read the contribution guidelines: https://golang.org/doc/contribute.html
Note that the Go project does not use GitHub pull requests, and that we use the issue tracker for bug reports and proposals only. See https://golang.org/wiki/Questions for a list of places to ask questions about the Go language.