]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/pgo: use slices for in/out edges
authorCherry Mui <cherryyz@google.com>
Fri, 4 Nov 2022 00:56:21 +0000 (20:56 -0400)
committerCherry Mui <cherryyz@google.com>
Fri, 4 Nov 2022 20:37:38 +0000 (20:37 +0000)
commit7e88b866f9576d6f9ddfe0a054da7383bfff54fa
treefb75ad85f7b1df41faa89022b3e7cac3a6091071
parenta72e133422d3eb2f24ca6f5d834c622137f0ccd2
cmd/compile/internal/pgo: use slices for in/out edges

Currently in the pprof Graph, a Node's in/out edges are
represented as maps, keyed by the source/destination Nodes. For a
Node it usually has a very small number of edges, so linear search
would be generally faster than map operations. Use slices and
linear search instead.

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