mirror of
https://github.com/golang/go
synced 2024-11-06 04:16:11 -07:00
9e16cc1541
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>
3 lines
116 B
Plaintext
3 lines
116 B
Plaintext
pkg hash/maphash, func Bytes(Seed, []uint8) uint64 #42710
|
|
pkg hash/maphash, func String(Seed, string) uint64 #42710
|