]> Cypherpunks repositories - gostls13.git/commit
runtime: strength reduce key pointer calculation in mapdelete_fast*
authorJosh Bleecher Snyder <josharian@gmail.com>
Mon, 21 Aug 2017 16:54:36 +0000 (09:54 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Wed, 23 Aug 2017 13:49:52 +0000 (13:49 +0000)
commit29e6bdc69c580cf6e9c4cc27600b7f4e2b0def9f
treeade293b5cf0c308a7f03a3e7cebf6b5e892299fd
parent61043d467115365dbbc0937510c9b91fa4a28f1d
runtime: strength reduce key pointer calculation in mapdelete_fast*

Move the tophash checks after the equality/length checks.

For fast32/fast64, since we've done a full equality check already,
just check whether tophash is empty instead of checking tophash.
This is cheaper and allows us to skip calculating tophash.

These changes are modeled on the changes in CL 57590,
which were polished based on benchmarking.
Benchmarking directly is impeded by #21546.

Change-Id: I0e17163028e34720310d1bf8f95c5ef42d223e00
Reviewed-on: https://go-review.googlesource.com/57611
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/runtime/hashmap_fast.go