]> Cypherpunks repositories - gostls13.git/commit
internal/runtime/maps: eliminate a load from the hot path
authorKeith Randall <khr@golang.org>
Fri, 15 Nov 2024 00:58:07 +0000 (16:58 -0800)
committerKeith Randall <khr@golang.org>
Sun, 17 Nov 2024 20:17:05 +0000 (20:17 +0000)
commit63f762bcdea96889d8ffa406804665b84bda63ab
tree6ec8508a506b512742af1d3415116f90d67ad7be
parent04807d3acf160b270fbec42b7b672d531dec06b7
internal/runtime/maps: eliminate a load from the hot path

typ.Group.Size involves two loads.

Instead cache GroupSize as a separate fields of the map type
so we can get to it in just one load.

Change-Id: I10ffdce1c7f75dcf448da14040fda78f0d75fd1d
Reviewed-on: https://go-review.googlesource.com/c/go/+/627716
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/cmd/compile/internal/reflectdata/map_swiss.go
src/cmd/link/internal/ld/deadcode.go
src/internal/abi/map_swiss.go
src/internal/runtime/maps/group.go
src/internal/runtime/maps/map.go
src/internal/runtime/maps/map_test.go