diff options
| author | Russ Cox <rsc@golang.org> | 2022-03-14 12:31:33 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2022-04-05 18:01:26 +0000 |
| commit | 9e16cc1541d42cb081d359339e3f45b4b9b2a372 (patch) | |
| tree | 469eeb85ad0f949b3bc46d91a807f675b9042b37 /src/make.bash | |
| parent | 9839668b5619f45e293dd40339bf0ac614ea6bee (diff) | |
| download | go-9e16cc1541d42cb081d359339e3f45b4b9b2a372.tar.xz | |
hash/maphash: add Bytes and String
For very small inputs, h.Reset+h.Write+h.Sum64 is fundamentally
slower than a single operation, by about a factor of two, because
Write must copy the data into h's buffer, just in case there is another
Write before the Sum64.
A single function doing the whole sequence knows there is no extra
write that will happen, so it doesn't need the buffer, so it avoids the copy.
Fixes #42710.
Change-Id: Icc79c68ccb10827f6640071d026df86b4940fcc1
Reviewed-on: https://go-review.googlesource.com/c/go/+/392494
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/make.bash')
0 files changed, 0 insertions, 0 deletions
