1
0
mirror of https://github.com/golang/go synced 2024-11-17 18:44:44 -07:00
go/src/encoding
ErikPelli e1b62efaf3 encoding/base64: optimize decodemap memory set
The existing implementation has an execution time higher in the benchmark than this one.
This is an optimized implementation using the copy() function and a constant 256 bytes string with the values to be copied.

```
name           old time/op    new time/op    delta
NewEncoding-4     329ns ± 1%     231ns ± 1%  -29.72%  (p=0.008 n=5+5)

name           old speed      new speed      delta
NewEncoding-4   778MB/s ± 1%  1108MB/s ± 1%  +42.29%  (p=0.008 n=5+5)
```

Fixes #53211

Change-Id: I80fe62aa40623125ef81ae9164a8405eed30b71b
GitHub-Last-Rev: 55dce6f636
GitHub-Pull-Request: golang/go#53212
Reviewed-on: https://go-review.googlesource.com/c/go/+/410194
Reviewed-by: Keith Randall <khr@google.com>
Run-TryBot: Keith Randall <khr@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-08-17 03:15:44 +00:00
..
ascii85 all: remove trailing blank doc comment lines 2022-04-01 18:18:07 +00:00
asn1 all: replace `` and '' with “ (U+201C) and ” (U+201D) in doc comments 2022-04-05 17:52:29 +00:00
base32 encoding/base64: optimize decodemap memory set 2022-08-17 03:15:44 +00:00
base64 encoding/base64: optimize decodemap memory set 2022-08-17 03:15:44 +00:00
binary encoding/binary: ReadUvarint return io.ErrUnexpectedEOF when read at least 1 byte 2022-08-08 17:29:13 +00:00
csv encoding/csv: add Reader.InputOffset method 2022-05-14 04:25:13 +00:00
gob encoding/gob: change typeInfo.encoder type to atomic.Pointer[T] 2022-08-09 21:26:45 +00:00
hex
json encoding/json: mention SyntaxError in Unmarshal doc comment 2022-06-01 22:59:44 +00:00
pem encoding/pem: fix stack overflow in Decode 2022-04-12 15:19:32 +00:00
xml encoding/xml: use bytes.Buffer.WriteString 2022-08-09 18:32:01 +00:00
encoding.go