Skip to content

Commit 608e9fa

Browse files
author
Mark Freeman
committed
go/types, types2: flip on position tracing
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 <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent 72e8237 commit 608e9fa

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ var nopos syntax.Pos
2222
const debug = false // leave on during development
2323

2424
// position tracing for panics during type checking
25-
const tracePos = false // TODO(markfreeman): check performance implications
25+
const tracePos = true
2626

2727
// _aliasAny changes the behavior of [Scope.Lookup] for "any" in the
2828
// [Universe] scope.

src/go/types/check.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ var noposn = atPos(nopos)
2525
const debug = false // leave on during development
2626

2727
// position tracing for panics during type checking
28-
const tracePos = false // TODO(markfreeman): check performance implications
28+
const tracePos = true
2929

3030
// gotypesalias controls the use of Alias types.
3131
// As of Apr 16 2024 they are used by default.

0 commit comments

Comments
 (0)