]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile/internal/pgo: use a slice for locations
authorCherry Mui <cherryyz@google.com>
Fri, 4 Nov 2022 01:11:23 +0000 (21:11 -0400)
committerCherry Mui <cherryyz@google.com>
Fri, 4 Nov 2022 22:09:36 +0000 (22:09 +0000)
commitd9cc39b25c8ebef5a976e34848dc3c5216108f07
tree15c93bbe0a7778513a9bea690a1c8d815e4221f3
parent6d58aea5d412d135ec08463db515ee9453c508b5
cmd/compile/internal/pgo: use a slice for locations

Currently locations are stored in a map and looked up by ID from
the map. The IDs are usually small sequential integers (the Go
pprof CPU profiles are so). Using a slice is more efficient (with
a fallback map to handle weirdly large IDs).

Change-Id: I9e20d5cebca3a5239636413e1bf2f0b273038031
Reviewed-on: https://go-review.googlesource.com/c/go/+/447803
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/compile/internal/pgo/graph.go
src/cmd/compile/internal/pgo/irgraph.go