]> Cypherpunks repositories - gostls13.git/commit
runtime: refactor evacuate x/y handling
authorJosh Bleecher Snyder <josharian@gmail.com>
Thu, 10 Aug 2017 14:16:27 +0000 (07:16 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Mon, 14 Aug 2017 23:51:14 +0000 (23:51 +0000)
commit77a9cb9b4c8f13e7b08ae855699146cbddbdd752
tree6ecf6817b78de1ee8f1503ffa240a1c6d1646437
parent589fc314af46e0d65a91fa1048ba319f1bf390a6
runtime: refactor evacuate x/y handling

This change unifies the x and y cases.

It shrinks evacuate's machine code by ~25% and its stack size by ~15%.

It also eliminates a critical branch.
Whether an entry should go to x or y is designed to be unpredictable.
As a result, half of the branch predictions for useX were wrong.
Mispredicting that branch can easily incur an expensive cache miss.
Switching to an xy array allows elimination of that branch,
which in turn reduces cache misses.

Change-Id: Ie9cef53744b96c724c377ac0985b487fc50b49b1
Reviewed-on: https://go-review.googlesource.com/54653
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.go