1
0
mirror of https://github.com/golang/go synced 2024-11-26 23:41:37 -07:00
go/src/encoding
Dmitrii Okunev d361691201 encoding/asn1: optimize asn1.Unmarshal
Used type-switch instead of switch by reflect.Type and added
BenchmarkUnmarshal.

name         old time/op    new time/op    delta
Marshal-8      28.1µs ± 2%    27.9µs ± 1%     ~     (p=0.094 n=9+9)
Unmarshal-8    6.45µs ± 1%    5.83µs ± 4%   -9.59%  (p=0.000 n=10+10)

name         old alloc/op   new alloc/op   delta
Marshal-8      8.26kB ± 0%    8.26kB ± 0%     ~     (all equal)
Unmarshal-8      840B ± 0%      488B ± 0%  -41.90%  (p=0.000 n=10+10)

name         old allocs/op  new allocs/op  delta
Marshal-8         363 ± 0%       363 ± 0%     ~     (all equal)
Unmarshal-8      50.0 ± 0%      43.0 ± 0%  -14.00%  (p=0.000 n=10+10)

Change-Id: I6b53833c7a3e2524f025453311841d03c1256a45
GitHub-Pull-Request: golang/go#36341
Reviewed-on: https://go-review.googlesource.com/c/go/+/268557
Trust: Filippo Valsorda <filippo@golang.org>
Trust: Roland Shoemaker <roland@golang.org>
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
2020-11-09 21:36:24 +00:00
..
ascii85 all: update references to symbols moved from io/ioutil to io 2020-10-20 18:41:18 +00:00
asn1 encoding/asn1: optimize asn1.Unmarshal 2020-11-09 21:36:24 +00:00
base32 all: update references to symbols moved from io/ioutil to io 2020-10-20 18:41:18 +00:00
base64 all: update references to symbols moved from io/ioutil to io 2020-10-20 18:41:18 +00:00
binary all: update references to symbols moved from io/ioutil to io 2020-10-20 18:41:18 +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: update references to symbols moved from io/ioutil to io 2020-10-20 18:41:18 +00:00
hex all: update references to symbols moved from io/ioutil to io 2020-10-20 18:41:18 +00:00
json encoding/json: add "json: " prefix to SyntaxError messages 2020-10-21 18:50:01 +00:00
pem all: update references to symbols moved from io/ioutil to io 2020-10-20 18:41:18 +00:00
xml encoding/xml: fix reserved namespace check to be case-insensitive 2020-10-21 23:51:30 +00:00
encoding.go