1
0
mirror of https://github.com/golang/go synced 2024-11-23 10:20:03 -07:00
go/src/encoding
Martin Möhrmann 861a948335 encoding/asn1: speed up marshal by reducing allocations
Replace strings.Split by strings.IndexByte and explicit
slicing to avoid the allocation of the return slice
of strings.Split.

name     old time/op    new time/op    delta
Marshal    43.3µs ± 1%    36.7µs ± 1%  -15.23%  (p=0.000 n=9+9)

name     old alloc/op   new alloc/op   delta
Marshal    10.7kB ± 0%     9.2kB ± 0%  -13.96%  (p=0.000 n=10+10)

name     old allocs/op  new allocs/op  delta
Marshal       444 ± 0%       366 ± 0%  -17.57%  (p=0.000 n=10+10)

Change-Id: I9e727defa23f7e5fc684f246de0136fe28cf8d25
Reviewed-on: https://go-review.googlesource.com/c/go/+/231738
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2020-08-18 17:46:40 +00:00
..
ascii85 encoding/ascii85: make bigtest big again 2017-06-23 14:28:30 +00:00
asn1 encoding/asn1: speed up marshal by reducing allocations 2020-08-18 17:46:40 +00:00
base32 encoding/base32: increase performance and code reuse 2019-09-11 00:56:39 +00:00
base64 encoding/base64: improve performance up to 20% total 2020-04-22 21:36:41 +00:00
binary encoding/binary: read at most MaxVarintLen64 bytes in ReadUvarint 2020-08-06 17:24:10 +00:00
csv encoding/csv: optimize Write by giving fieldNeedsQuotes a fast path for when Comma is ascii 2020-05-05 23:57:19 +00:00
gob all: fix a number of misuses of the word "an" 2019-12-10 16:23:10 +00:00
hex encoding/hex: remove unused variable from BenchmarkDump 2020-03-03 14:53:52 +00:00
json Revert "encoding/json: don't reuse slice elements when decoding" 2020-07-02 22:08:11 +00:00
pem all: remove PEM-encoded private keys from tests 2019-05-21 20:03:55 +00:00
xml Revert "encoding/xml: fix reserved namespace check to be case-insensitive" 2020-06-29 21:33:02 +00:00
encoding.go