mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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>
This commit is contained in:
parent
6d58aea5d4
commit
d9cc39b25c
2 changed files with 29 additions and 10 deletions
|
|
@ -140,7 +140,7 @@ func New(profileFile string) *Profile {
|
|||
return nil
|
||||
}
|
||||
|
||||
g, _ := newGraph(profile, &Options{
|
||||
g := newGraph(profile, &Options{
|
||||
CallTree: false,
|
||||
SampleValue: func(v []int64) int64 { return v[1] },
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue