From 3237af2da88c82d4938b392d2644d65637a11526 Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Fri, 31 Mar 2017 10:28:54 -0700 Subject: [PATCH] cmd/compile: don't use lookupN for statictmps MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The names never occur more than once, so interning the results is counterproductive. The impact is not very big, but neither is the fix. name old time/op new time/op delta Unicode 90.2ms ± 3% 88.3ms ± 5% -2.10% (p=0.000 n=94+98) Change-Id: I1e3a24433db4ae0c9a6e98166568941824ff0779 Reviewed-on: https://go-review.googlesource.com/39193 Run-TryBot: Josh Bleecher Snyder TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/cmd/compile/internal/gc/sinit.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/compile/internal/gc/sinit.go b/src/cmd/compile/internal/gc/sinit.go index fb6570cec1..0426b7e474 100644 --- a/src/cmd/compile/internal/gc/sinit.go +++ b/src/cmd/compile/internal/gc/sinit.go @@ -575,7 +575,7 @@ var statuniqgen int // name generator for static temps // Callers should call n.Name.SetReadonly(true) on the // returned node for readonly nodes. func staticname(t *Type) *Node { - n := newname(lookupN("statictmp_", statuniqgen)) + n := newname(lookup(fmt.Sprintf("statictmp_%d", statuniqgen))) statuniqgen++ addvar(n, t, PEXTERN) return n -- 2.48.1