]> Cypherpunks repositories - gostls13.git/commitdiff
go/types, types2: flip on position tracing
authorMark Freeman <mark@golang.org>
Wed, 28 May 2025 16:12:35 +0000 (12:12 -0400)
committerMark Freeman <mark@golang.org>
Wed, 6 Aug 2025 18:05:55 +0000 (11:05 -0700)
Running compilebench with flags off / on, we get the below:

                         │   old.txt    │              new.txt               │
                         │    sec/op    │   sec/op     vs base               │
Template                    149.2m ± 6%   155.5m ± 5%       ~ (p=0.280 n=10)
Unicode                     110.1m ± 3%   105.8m ± 7%       ~ (p=0.280 n=10)
GoTypes                     774.0m ± 6%   757.7m ± 2%       ~ (p=0.247 n=10)
Compiler                    109.6m ± 6%   109.8m ± 6%       ~ (p=0.579 n=10)
SSA                          4.562 ± 2%    4.550 ± 2%       ~ (p=0.436 n=10)
Flate                      101.65m ± 9%   96.32m ± 7%  -5.24% (p=0.043 n=10)
GoParser                    168.7m ± 6%   173.7m ± 6%       ~ (p=0.436 n=10)
Reflect                     390.2m ± 5%   387.8m ± 6%       ~ (p=0.684 n=10)
Tar                         185.9m ± 3%   182.2m ± 4%       ~ (p=0.529 n=10)
XML                         212.7m ± 4%   211.4m ± 4%       ~ (p=0.971 n=10)
LinkCompiler                490.9m ± 4%   480.4m ± 4%       ~ (p=0.353 n=10)
ExternalLinkCompiler         1.501 ± 1%    1.501 ± 1%       ~ (p=0.853 n=10)
LinkWithoutDebugCompiler    311.8m ± 4%   308.6m ± 4%       ~ (p=0.579 n=10)
StdCmd                       17.60 ± 1%    17.62 ± 1%       ~ (p=0.912 n=10)
geomean                     427.5m        424.2m       -0.77%

Overall, we do not see a statistically significant perforance impact. Flate
actually reports a speedup, but with a p-value of 0.043, it's quite close
to the significance threshold (which is fairly lenient). In my opinion,
this is likely due to chance.

Fixes #51603

Change-Id: I7f439730be45e02c7f799df768590ef78e321952
Reviewed-on: https://go-review.googlesource.com/c/go/+/676816
Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

src/cmd/compile/internal/types2/check.go
src/go/types/check.go

index 31a1aa2abe9290b945c87d01693a7013d6c6caa3..411a1719ce4bb528d9b00f6eae8f70e48ebbb96a 100644 (file)
@@ -22,7 +22,7 @@ var nopos syntax.Pos
 const debug = false // leave on during development
 
 // position tracing for panics during type checking
-const tracePos = false // TODO(markfreeman): check performance implications
+const tracePos = true
 
 // _aliasAny changes the behavior of [Scope.Lookup] for "any" in the
 // [Universe] scope.
index e4e8e95c9974b9c3652606aa9821ab975a0af9de..c9753280bf8685447033c0cb2cf972f750330975 100644 (file)
@@ -25,7 +25,7 @@ var noposn = atPos(nopos)
 const debug = false // leave on during development
 
 // position tracing for panics during type checking
-const tracePos = false // TODO(markfreeman): check performance implications
+const tracePos = true
 
 // gotypesalias controls the use of Alias types.
 // As of Apr 16 2024 they are used by default.