diff options
author | Heschi Kreinick <heschi@google.com> | 2018-02-02 16:26:58 -0500 |
---|---|---|
committer | Heschi Kreinick <heschi@google.com> | 2018-02-21 18:01:22 +0000 |
commit | e181852dd487b97c0ed3662573793ca77f3299b0 (patch) | |
tree | 38639124007132a77187805b30f352850fb40009 /src/cmd/compile/internal/ssa/export_test.go | |
parent | 108efc79c726402e13acae0299e9a7597a4d33ce (diff) | |
download | go-e181852dd487b97c0ed3662573793ca77f3299b0.tar.gz go-e181852dd487b97c0ed3662573793ca77f3299b0.zip |
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>
Diffstat (limited to 'src/cmd/compile/internal/ssa/export_test.go')
-rw-r--r-- | src/cmd/compile/internal/ssa/export_test.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/ssa/export_test.go b/src/cmd/compile/internal/ssa/export_test.go index d1d6831eb3..ac7a1b00e0 100644 --- a/src/cmd/compile/internal/ssa/export_test.go +++ b/src/cmd/compile/internal/ssa/export_test.go @@ -79,6 +79,10 @@ func (d *DummyAuto) StorageClass() StorageClass { return ClassAuto } +func (d *DummyAuto) IsSynthetic() bool { + return false +} + func (DummyFrontend) StringData(s string) interface{} { return nil } |