]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal: use sparseSet, optimize isSynthetic
authorHeschi Kreinick <heschi@google.com>
Fri, 2 Feb 2018 21:26:58 +0000 (16:26 -0500)
committerHeschi Kreinick <heschi@google.com>
Wed, 21 Feb 2018 18:01:22 +0000 (18:01 +0000)
commite181852dd487b97c0ed3662573793ca77f3299b0
tree38639124007132a77187805b30f352850fb40009
parent108efc79c726402e13acae0299e9a7597a4d33ce
cmd/compile/internal: use sparseSet, optimize isSynthetic

changedVars was functionally a set, but couldn't be iterated over
efficiently. In functions with many variables, the wasted iteration was
costly. Use a sparseSet instead.

(*gc.Node).String() is very expensive: it calls Sprintf, which does
reflection, etc, etc. Instead, just look at .Sym.Name, which is all we
care about.

Change-Id: Ib61cd7b5c796e1813b8859135e85da5bfe2ac686
Reviewed-on: https://go-review.googlesource.com/92402
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/gc/syntax.go
src/cmd/compile/internal/ssa/config.go
src/cmd/compile/internal/ssa/debug.go
src/cmd/compile/internal/ssa/export_test.go