commit | ae4aac00bba5d1d616408a1c07bd4ef5691e3a00 | [log] [tgz] |
---|---|---|
author | Hiroshi Ioka <hirochachacha@gmail.com> | Tue Aug 02 14:41:53 2016 +0900 |
committer | Brad Fitzpatrick <bradfitz@golang.org> | Tue Sep 13 21:05:27 2016 +0000 |
tree | f5e2b6856fea65d469af67b5334a13bcce06c90f | |
parent | ee3f3a60070ee9edeb3f10fa2e4b90404068cb3a [diff] |
encoding/asn1: reduce allocations in Marshal Current code uses trees of bytes.Buffer as data representation. Each bytes.Buffer takes 4k bytes at least, so it's waste of memory. The change introduces trees of lazy-encoder as alternative one which reduce allocations. name old time/op new time/op delta Marshal-4 64.7µs ± 2% 42.0µs ± 1% -35.07% (p=0.000 n=9+10) name old alloc/op new alloc/op delta Marshal-4 35.1kB ± 0% 7.6kB ± 0% -78.27% (p=0.000 n=10+10) name old allocs/op new allocs/op delta Marshal-4 503 ± 0% 293 ± 0% -41.75% (p=0.000 n=10+10) Change-Id: I32b96c20b8df00414b282d69743d71a598a11336 Reviewed-on: https://go-review.googlesource.com/27030 Reviewed-by: Adam Langley <agl@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Adam Langley <agl@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
For documentation about how to install and use Go, visit https://golang.org/ or load doc/install-source.html in your web browser.
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.
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
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
If you have just untarred a binary Go distribution, you need to set the environment variable $GOROOT to the full path of the go directory (the one containing this file). You can omit the variable if you unpack it into /usr/local/go, or if you rebuild from sources by running all.bash (see doc/install-source.html). You should also add the Go binary directory $GOROOT/bin to your shell's path.
For example, if you extracted the tar file into $HOME/go, you might put the following in your .profile:
export GOROOT=$HOME/go export PATH=$PATH:$GOROOT/bin
See https://golang.org/doc/install or doc/install.html for more details.