Skip to content

ssa: avoid exponential traversal of shared type conversion graphs - #2625

Merged
xushiwei merged 1 commit into
xgo-dev:mainfrom
zhouguangyuan0718:codex/type-conversion-query-20260918
Sep 21, 2026
Merged

xushiwei merged 1 commit into
xgo-dev:mainfrom
zhouguangyuan0718:codex/type-conversion-query-20260918

Conversation

@zhouguangyuan0718

@zhouguangyuan0718 zhouguangyuan0718 commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Conversion-need queries revisit a named type whenever a previous traversal of that type has completed. A shared type graph can therefore require exponentially many traversals; a 48-node diamond graph times out after five seconds. While compiling TypeScript Go tsc for js/wasm, process sampling showed repeated recursion in this query after several minutes of compilation.

Keep named types visited for the entire reachability query. Repeated edges need no further search, while positive results still propagate along proven paths and negative results enter the cross-query cache only after a complete negative query. This preserves the recursive conversion decisions and named-type identities.

Validation:

  • New 48-node shared-graph regression times out on the baseline and passes with the fix.
  • GOWORK=off go test ./ssa -count=1 -timeout=120s passes, including recursive generic types and traversal-order tests.

The x/tools update from #2622 is now in main. With this fix integrated, LLGo successfully compiled and linked the full TypeScript Go tsc/cmd/tsc (c975de5011fb7dfb32a491cf3fcf02d4f811f50e) for GOOS=js GOARCH=wasm. --version prints 7.1.0-dev under Node with the LLGo host adapter. The subsequent runtime nil-pointer symptom was traced to fixed WASM worker stack overflow. #2626 adds checked bounds and a general stack-budget option; with a 2 MiB worker stack, strict ES2022 compilation, emitted JS, declarations and diagnostics now match standard-Go tsc.

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review summary

Solid, well-scoped change. It removes the reflection-based special-casing of x/tools opaqueType (cvtGoSSAOpaqueType/isGoSSAOpaqueType and the reflect import) and instead routes iterator/defer-stack handles through the ordinary named-type path, since x/tools now models them as named unsafe.Pointer types. The conversionNeedQuery state machine is simplified from a visiting/seen struct to a plain map[*types.Named]bool visited set, and completed nodes stay visited so shared subgraphs are not re-traversed.

Verified across all four review dimensions:

  • Correctness: The caching invariants hold. A node needing conversion always propagates true upward, so the negative bulk-cache block never runs for a query touching it — no node needing conversion can be wrongly cached as conversionNotNeeded. Back-edge false returns never become a node's final answer.
  • Performance: The exponential-to-linear claim checks out — query[t] is set before recursion and never cleared, so a re-reached completed Named short-circuits. TestSharedNamedTypeConversionGraph (48-deep, two edges/node) collapses ~2^48 paths to 48 visits.
  • Security: The unsafe.Pointer map keys are the standard pointer-identity idiom (live values kept reachable, round-tripped to their original concrete type) — no memory-safety concern. Dependency bumps (x/tools v0.50.0, x/mod, x/sys, x/sync) are forward-only with consistent go.sum hashes.
  • Docs/tests: Updated comments accurately match the new traversal; the buildGoSSAPackageForOpaque -> buildGoSSAPackageForInternalTypes rename and TestGoSSAInternalPointerTypes reframing are complete and consistent.

Note: I could not compile/run tests locally (the xgo-dev/llvm cgo dependency needs LLVM headers not present in this environment) — relying on CI for build verification.

One non-blocking observation below.

Additional findings

  • ssa/type_cvt.go:236: [P3] Clean subgraphs under a conversion-needing query are not memoized: Negative results are bulk-cached only when the top-level query returns false (this block). Positive results are cached per-node at line 291. As a consequence, when a query returns true, any conversion-free named subgraph explored before the true-returning sibling is left conversionUnknown — it is neither in the persistent cvtneed cache nor bulk-stored here — so a later independent query re-traverses it from scratch.

@codecov

codecov Bot commented Sep 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions

github-actions Bot commented Sep 18, 2026

Copy link
Copy Markdown

LLGo WebAssembly build benchmarks

49aa4e543026 | workflow run | long-term charts

WebAssembly output sizes
Example, profile and compiler Wasm module vs base Generated JS glue vs base
cprintf/j32-emscripten/LLGo 135746 B 0 B / +0.0% 70786 B 0 B / +0.0%
cprintf/j32-goos-js/LLGo 133995 B 0 B / +0.0% 69150 B 0 B / +0.0%
cprintf/j64-emscripten-memory64/LLGo 124243 B 0 B / +0.0% 73998 B 0 B / +0.0%
cprintf/w32-goos-wasip1/LLGo 138261 B 0 B / +0.0% 0 B 0 B / 0.0%
cprintf/w32-wasi/LLGo 138265 B 0 B / +0.0% 0 B 0 B / 0.0%
fmtprintf/j32-emscripten/LLGo 3090846 B 0 B / +0.0% 114540 B 0 B / +0.0%
fmtprintf/j32-goos-js/Go 2526852 B 0 B / +0.0% 0 B 0 B / 0.0%
fmtprintf/j32-goos-js/LLGo 3082849 B 0 B / +0.0% 98239 B 0 B / +0.0%
fmtprintf/j64-emscripten-memory64/LLGo 2829305 B 0 B / +0.0% 121521 B 0 B / +0.0%
fmtprintf/w32-goos-wasip1/Go 2500019 B 0 B / +0.0% 0 B 0 B / 0.0%
fmtprintf/w32-goos-wasip1/LLGo 2829104 B 0 B / +0.0% 0 B 0 B / 0.0%
fmtprintf/w32-wasi/LLGo 2697658 B 0 B / +0.0% 0 B 0 B / 0.0%
j32-emscripten/LLGo 135020 B 0 B / +0.0% 70786 B 0 B / +0.0%
j32-goos-js/Go 1895533 B 0 B / +0.0% 0 B 0 B / 0.0%
j32-goos-js/LLGo 133441 B 0 B / +0.0% 69150 B 0 B / +0.0%
j64-emscripten-memory64/LLGo 123573 B 0 B / +0.0% 73998 B 0 B / +0.0%
reflectcall/j32-emscripten/LLGo 1481332 B 0 B / +0.0% 88949 B 0 B / +0.0%
reflectcall/j32-goos-js/Go 2191221 B 0 B / +0.0% 0 B 0 B / 0.0%
reflectcall/j32-goos-js/LLGo 1483040 B 0 B / +0.0% 87313 B 0 B / +0.0%
reflectcall/j64-emscripten-memory64/LLGo 1368320 B 0 B / +0.0% 94158 B 0 B / +0.0%
reflectcall/w32-goos-wasip1/Go 2205707 B 0 B / +0.0% 0 B 0 B / 0.0%
reflectcall/w32-goos-wasip1/LLGo 1534207 B 0 B / +0.0% 0 B 0 B / 0.0%
reflectcall/w32-wasi/LLGo 1460842 B 0 B / +0.0% 0 B 0 B / 0.0%
w32-goos-wasip1/Go 1909947 B 0 B / +0.0% 0 B 0 B / 0.0%
w32-goos-wasip1/LLGo 137550 B 0 B / +0.0% 0 B 0 B / 0.0%
w32-wasi/LLGo 137621 B 0 B / +0.0% 0 B 0 B / 0.0%
LLGo WebAssembly build measurements
Example and profile Build vs base
j32-emscripten 6.053 s -59.66 ms / -1.0% (better)
j32-goos-js 6.001 s -649.1 ms / -9.8% (better)
j64-emscripten-memory64 5.244 s -170.6 ms / -3.2% (better)
reflectcall/w32-wasi 28.973 s +1.63 s / +6.0% (worse)
w32-goos-wasip1 4.548 s -226.8 ms / -4.8% (better)
w32-wasi 4.535 s -16.63 ms / -0.4% (better)

Compared with 943120d1a365 measured in the same runner job.

@github-actions

github-actions Bot commented Sep 18, 2026

Copy link
Copy Markdown

LLGo baseline benchmarks

49aa4e543026 | workflow run | long-term charts

Program measurements

Platform Workload File size vs base Text size vs base Build vs base Run vs base
Linux cprintf 20040 B 0 B / +0.0% 387 B 0 B / +0.0% 533.568 ms +66.87 ms / +14.3% (worse) 1.290 ms +43.53 us / +3.5% (worse)
Linux cprintf-lto 19792 B 0 B / +0.0% 368 B 0 B / +0.0% 580.758 ms +87.33 ms / +17.7% (worse) 1.413 ms +178.8 us / +14.5% (worse)
Linux fmtprintf 1640328 B -8 B / -0.0004877% (better) 487292 B 0 B / +0.0% 5.658 s +1.66 s / +41.5% (worse) 4.349 ms +1.144 ms / +35.7% (worse)
Linux fmtprintf-lto 1478584 B 0 B / +0.0% 422855 B 0 B / +0.0% 16.989 s +5.613 s / +49.3% (worse) 28.964 ms +26.11 ms / +916.1% (worse)
Linux println 62160 B 0 B / +0.0% 14647 B 0 B / +0.0% 529.616 ms +65.42 ms / +14.1% (worse) 1.684 ms +173.6 us / +11.5% (worse)
Linux println-lto 54248 B 0 B / +0.0% 12115 B 0 B / +0.0% 728.851 ms +15.13 ms / +2.1% (worse) 1.569 ms -32.78 us / -2.0% (better)
macOS cprintf 84480 B 0 B / +0.0% 17309 B 0 B / +0.0% 616.298 ms -9.731 ms / -1.6% (better) 2.476 ms -3.545 ms / -58.9% (better)
macOS cprintf-lto 84288 B 0 B / +0.0% 13073 B 0 B / +0.0% 563.696 ms -166.3 ms / -22.8% (better) 2.360 ms -1.523 ms / -39.2% (better)
macOS fmtprintf 1483824 B 0 B / +0.0% 862036 B 0 B / +0.0% 3.223 s +200.1 ms / +6.6% (worse) 4.226 ms +484.3 us / +12.9% (worse)
macOS fmtprintf-lto 1175808 B 0 B / +0.0% 832996 B 0 B / +0.0% 10.142 s +1.223 s / +13.7% (worse) 6.435 ms +1.01 ms / +18.6% (worse)
macOS println 114672 B 0 B / +0.0% 34882 B 0 B / +0.0% 527.917 ms -106.3 ms / -16.8% (better) 2.865 ms -5.285 ms / -64.8% (better)
macOS println-lto 118720 B 0 B / +0.0% 32320 B 0 B / +0.0% 776.475 ms -245.6 ms / -24.0% (better) 5.039 ms +1.304 ms / +34.9% (worse)
Windows MinGW cprintf 19456 B 0 B / +0.0% 4550 B 0 B / +0.0% 860.912 ms -50.49 ms / -5.5% (better) 2.838 ms +58.4 us / +2.1% (worse)
Windows MinGW cprintf-lto 17920 B 0 B / +0.0% 4486 B 0 B / +0.0% 876.793 ms -12.81 ms / -1.4% (better) 2.846 ms -132.4 us / -4.4% (better)
Windows MinGW fmtprintf 1913856 B 0 B / +0.0% 589718 B 0 B / +0.0% 3.188 s +7.322 ms / +0.2% (worse) 6.361 ms +255.5 us / +4.2% (worse)
Windows MinGW fmtprintf-lto 1934848 B 0 B / +0.0% 535846 B 0 B / +0.0% 7.914 s +74.38 ms / +0.9% (worse) 6.858 ms +691.3 us / +11.2% (worse)
Windows MinGW println 71168 B 0 B / +0.0% 23702 B 0 B / +0.0% 854.667 ms -5.566 ms / -0.6% (better) 5.095 ms +14.2 us / +0.3% (worse)
Windows MinGW println-lto 65024 B 0 B / +0.0% 20406 B 0 B / +0.0% 1.014 s -2.927 ms / -0.3% (better) 4.934 ms -137.3 us / -2.7% (better)
Windows MinGW 386 cprintf 43008 B 0 B / +0.0% 5326 B 0 B / +0.0% 911.002 ms -4.58 ms / -0.5% (better) 3.845 ms -569.7 us / -12.9% (better)
Windows MinGW 386 cprintf-lto 20992 B 0 B / +0.0% 5094 B 0 B / +0.0% 1.079 s +188.9 ms / +21.2% (worse) 3.836 ms -658.3 us / -14.6% (better)
Windows MinGW 386 fmtprintf 1876992 B 0 B / +0.0% 463342 B 0 B / +0.0% 3.404 s +158.6 ms / +4.9% (worse) 7.984 ms +171.5 us / +2.2% (worse)
Windows MinGW 386 fmtprintf-lto 2152448 B 0 B / +0.0% 440730 B 0 B / +0.0% 8.046 s +346.5 ms / +4.5% (worse) 8.045 ms -198.5 us / -2.4% (better)
Windows MinGW 386 println 91136 B 0 B / +0.0% 19814 B 0 B / +0.0% 900.783 ms +29.92 ms / +3.4% (worse) 6.786 ms +110.1 us / +1.6% (worse)
Windows MinGW 386 println-lto 69120 B 0 B / +0.0% 17742 B 0 B / +0.0% 1.089 s +62.4 ms / +6.1% (worse) 6.525 ms -97.2 us / -1.5% (better)
Windows MinGW ARM64 cprintf 18944 B 0 B / +0.0% 4408 B 0 B / +0.0% 1.389 s +12.42 ms / +0.9% (worse) 6.610 ms +591.7 us / +9.8% (worse)
Windows MinGW ARM64 cprintf-lto 17920 B 0 B / +0.0% 4340 B 0 B / +0.0% 1.413 s +11.19 ms / +0.8% (worse) 6.088 ms -414.5 us / -6.4% (better)
Windows MinGW ARM64 fmtprintf 1801728 B 0 B / +0.0% 502004 B 0 B / +0.0% 4.252 s +50.6 ms / +1.2% (worse) 12.461 ms +266.4 us / +2.2% (worse)
Windows MinGW ARM64 fmtprintf-lto 1858560 B 0 B / +0.0% 466144 B 0 B / +0.0% 10.083 s +595.7 ms / +6.3% (worse) 13.792 ms +587.3 us / +4.4% (worse)
Windows MinGW ARM64 println 68096 B 0 B / +0.0% 22376 B 0 B / +0.0% 1.367 s +5.488 ms / +0.4% (worse) 10.912 ms +89.9 us / +0.8% (worse)
Windows MinGW ARM64 println-lto 63488 B 0 B / +0.0% 19444 B 0 B / +0.0% 1.561 s +22.45 ms / +1.5% (worse) 10.755 ms +115.4 us / +1.1% (worse)
Windows MSVC cprintf 120320 B 0 B / +0.0% 65782 B 0 B / +0.0% 762.177 ms -210.1 ms / -21.6% (better) 2.243 ms -89.9 us / -3.9% (better)
Windows MSVC cprintf-lto 119808 B 0 B / +0.0% 65718 B 0 B / +0.0% 864.393 ms +136.3 ms / +18.7% (worse) 2.235 ms -131.4 us / -5.6% (better)
Windows MSVC fmtprintf 1628160 B 0 B / +0.0% 685238 B 0 B / +0.0% 2.849 s -219.3 ms / -7.1% (better) 5.806 ms -615.6 us / -9.6% (better)
Windows MSVC fmtprintf-lto 1616896 B 0 B / +0.0% 636262 B 0 B / +0.0% 6.835 s -100.2 ms / -1.4% (better) 5.959 ms -208.5 us / -3.4% (better)
Windows MSVC println 192512 B 0 B / +0.0% 119126 B 0 B / +0.0% 685.808 ms -205.2 ms / -23.0% (better) 3.636 ms -1.463 ms / -28.7% (better)
Windows MSVC println-lto 189952 B 0 B / +0.0% 116374 B 0 B / +0.0% 768.350 ms -227.9 ms / -22.9% (better) 4.843 ms -408.4 us / -7.8% (better)
Windows MSVC 386 cprintf 9728 B 0 B / +0.0% 3931 B 0 B / +0.0% 1.061 s -18.7 ms / -1.7% (better) 6.198 ms -204.8 us / -3.2% (better)
Windows MSVC 386 cprintf-lto 9216 B 0 B / +0.0% 3853 B 0 B / +0.0% 1.054 s -118.7 ms / -10.1% (better) 6.290 ms -240 us / -3.7% (better)
Windows MSVC 386 fmtprintf 1190400 B 0 B / +0.0% 446693 B 0 B / +0.0% 4.177 s -69.42 ms / -1.6% (better) 13.221 ms +35.4 us / +0.3% (worse)
Windows MSVC 386 fmtprintf-lto 1224704 B 0 B / +0.0% 417385 B 0 B / +0.0% 9.384 s -370.6 ms / -3.8% (better) 13.700 ms -578.2 us / -4.0% (better)
Windows MSVC 386 println 34304 B 0 B / +0.0% 18641 B 0 B / +0.0% 1.180 s +108.3 ms / +10.1% (worse) 14.332 ms +3.155 ms / +28.2% (worse)
Windows MSVC 386 println-lto 32256 B 0 B / +0.0% 16855 B 0 B / +0.0% 1.190 s -50.29 ms / -4.1% (better) 10.793 ms -165.8 us / -1.5% (better)
Windows MSVC ARM64 cprintf 11264 B 0 B / +0.0% 3976 B 0 B / +0.0% 1.184 s +10.21 ms / +0.9% (worse) 7.778 ms +276.3 us / +3.7% (worse)
Windows MSVC ARM64 cprintf-lto 10752 B 0 B / +0.0% 3868 B 0 B / +0.0% 1.205 s +2.75 ms / +0.2% (worse) 7.508 ms -46 us / -0.6% (better)
Windows MSVC ARM64 fmtprintf 1372672 B 0 B / +0.0% 501636 B 0 B / +0.0% 4.019 s -51.08 ms / -1.3% (better) 15.363 ms -874.8 us / -5.4% (better)
Windows MSVC ARM64 fmtprintf-lto 1387520 B 0 B / +0.0% 466564 B 0 B / +0.0% 9.589 s +404.9 ms / +4.4% (worse) 18.614 ms +2.006 ms / +12.1% (worse)
Windows MSVC ARM64 println 41984 B 0 B / +0.0% 22168 B 0 B / +0.0% 1.172 s +16.03 ms / +1.4% (worse) 13.215 ms +118.8 us / +0.9% (worse)
Windows MSVC ARM64 println-lto 39424 B 0 B / +0.0% 19356 B 0 B / +0.0% 1.342 s -30.53 ms / -2.2% (better) 14.017 ms -99.1 us / -0.7% (better)
Core language and compiler benchmarks
Platform Benchmark ns/op vs base
Linux BenchmarkLookupPCRandom 15 ns/op +0.31 ns/op / +2.1% (worse)
Linux BenchmarkMergeCompilerFlags 237.900 ns/op +37.4 ns/op / +18.7% (worse)
Linux BenchmarkMergeLinkerFlags 135.600 ns/op +2.3 ns/op / +1.7% (worse)
Linux BenchmarkChannelBuffered 57.280 ns/op +1.25 ns/op / +2.2% (worse)
Linux BenchmarkChannelHandoff 13744 ns/op +527 ns/op / +4.0% (worse)
Linux BenchmarkDefer 59.590 ns/op +6.85 ns/op / +13.0% (worse)
Linux BenchmarkDirectCall 1.587 ns/op -0.005 ns/op / -0.3% (better)
Linux BenchmarkGlobalRead 1.176 ns/op -0.012 ns/op / -1.0% (better)
Linux BenchmarkGlobalWrite 7.804 ns/op -0.017 ns/op / -0.2% (better)
Linux BenchmarkGoroutine 21293 ns/op -4181 ns/op / -16.4% (better)
Linux BenchmarkInterfaceCall 6.157 ns/op +0.017 ns/op / +0.3% (worse)
Linux BenchmarkRuntimeGetG 2.473 ns/op -0.22 ns/op / -8.2% (better)
macOS BenchmarkLookupPCRandom 16.570 ns/op -5.15 ns/op / -23.7% (better)
macOS BenchmarkMergeCompilerFlags 135.900 ns/op -11.8 ns/op / -8.0% (better)
macOS BenchmarkMergeLinkerFlags 93.070 ns/op -2.46 ns/op / -2.6% (better)
macOS BenchmarkChannelBuffered 30.460 ns/op -9.58 ns/op / -23.9% (better)
macOS BenchmarkChannelHandoff 12617 ns/op +1096 ns/op / +9.5% (worse)
macOS BenchmarkDefer 42.530 ns/op -13.11 ns/op / -23.6% (better)
macOS BenchmarkDirectCall 1.254 ns/op -0.33 ns/op / -20.8% (better)
macOS BenchmarkGlobalRead 1.284 ns/op -0.061 ns/op / -4.5% (better)
macOS BenchmarkGlobalWrite 1.220 ns/op -0.75 ns/op / -38.1% (better)
macOS BenchmarkGoroutine 37279 ns/op -617 ns/op / -1.6% (better)
macOS BenchmarkInterfaceCall 4.742 ns/op -1.341 ns/op / -22.0% (better)
macOS BenchmarkRuntimeGetG 3.461 ns/op +0.759 ns/op / +28.1% (worse)
Windows MinGW BenchmarkLookupPCRandom 9.640 ns/op +0.036 ns/op / +0.4% (worse)
Windows MinGW BenchmarkMergeCompilerFlags 374.900 ns/op -37.4 ns/op / -9.1% (better)
Windows MinGW BenchmarkMergeLinkerFlags 332.600 ns/op -0.7 ns/op / -0.2% (better)
Windows MinGW BenchmarkChannelBuffered 23.630 ns/op -0.07 ns/op / -0.3% (better)
Windows MinGW BenchmarkChannelHandoff 1117 ns/op -3 ns/op / -0.3% (better)
Windows MinGW BenchmarkDefer 41.870 ns/op +0.14 ns/op / +0.3% (worse)
Windows MinGW BenchmarkDirectCall 1.086 ns/op -0.001 ns/op / -0.1% (better)
Windows MinGW BenchmarkGlobalRead 1.356 ns/op -0.002 ns/op / -0.1% (better)
Windows MinGW BenchmarkGlobalWrite 2.163 ns/op -0.003 ns/op / -0.1% (better)
Windows MinGW BenchmarkGoroutine 54718 ns/op +391 ns/op / +0.7% (worse)
Windows MinGW BenchmarkInterfaceCall 6.246 ns/op -0.004 ns/op / -0.1% (better)
Windows MinGW BenchmarkRuntimeGetG 1.409 ns/op +0.002 ns/op / +0.1% (worse)
Windows MinGW 386 BenchmarkLookupPCRandom 21.570 ns/op -0.04 ns/op / -0.2% (better)
Windows MinGW 386 BenchmarkMergeCompilerFlags 542 ns/op -42.1 ns/op / -7.2% (better)
Windows MinGW 386 BenchmarkMergeLinkerFlags 513.900 ns/op -37.7 ns/op / -6.8% (better)
Windows MinGW 386 BenchmarkChannelBuffered 33.860 ns/op -0.06 ns/op / -0.2% (better)
Windows MinGW 386 BenchmarkChannelHandoff 679 ns/op -39 ns/op / -5.4% (better)
Windows MinGW 386 BenchmarkDefer 36.440 ns/op -0.88 ns/op / -2.4% (better)
Windows MinGW 386 BenchmarkDirectCall 1.356 ns/op -0.002 ns/op / -0.1% (better)
Windows MinGW 386 BenchmarkGlobalRead 1.634 ns/op +0.004 ns/op / +0.2% (worse)
Windows MinGW 386 BenchmarkGlobalWrite 6.979 ns/op -0.02 ns/op / -0.3% (better)
Windows MinGW 386 BenchmarkGoroutine 58064 ns/op +537 ns/op / +0.9% (worse)
Windows MinGW 386 BenchmarkInterfaceCall 7.330 ns/op +0.009 ns/op / +0.1% (worse)
Windows MinGW 386 BenchmarkRuntimeGetG 1.632 ns/op -0.001 ns/op / -0.1% (better)
Windows MinGW ARM64 BenchmarkLookupPCRandom 12.080 ns/op +0.04 ns/op / +0.3% (worse)
Windows MinGW ARM64 BenchmarkMergeCompilerFlags 576.900 ns/op +13.4 ns/op / +2.4% (worse)
Windows MinGW ARM64 BenchmarkMergeLinkerFlags 543.700 ns/op +15.3 ns/op / +2.9% (worse)
Windows MinGW ARM64 BenchmarkChannelBuffered 37.640 ns/op +0.02 ns/op / +0.1% (worse)
Windows MinGW ARM64 BenchmarkChannelHandoff 2256 ns/op -14 ns/op / -0.6% (better)
Windows MinGW ARM64 BenchmarkDefer 54.530 ns/op -0.56 ns/op / -1.0% (better)
Windows MinGW ARM64 BenchmarkDirectCall 0.590 ns/op -0.0001 ns/op / -0.01696% (better)
Windows MinGW ARM64 BenchmarkGlobalRead 0.590 ns/op -0.0007 ns/op / -0.1% (better)
Windows MinGW ARM64 BenchmarkGlobalWrite 0.589 ns/op -0.0002 ns/op / -0.03392% (better)
Windows MinGW ARM64 BenchmarkGoroutine 54796 ns/op -3479 ns/op / -6.0% (better)
Windows MinGW ARM64 BenchmarkInterfaceCall 4.144 ns/op 0 ns/op / +0.0%
Windows MinGW ARM64 BenchmarkRuntimeGetG 1.805 ns/op +0.003 ns/op / +0.2% (worse)
Windows MSVC BenchmarkLookupPCRandom 7.310 ns/op -0.35 ns/op / -4.6% (better)
Windows MSVC BenchmarkMergeCompilerFlags 971.700 ns/op +302.1 ns/op / +45.1% (worse)
Windows MSVC BenchmarkMergeLinkerFlags 599 ns/op +3.4 ns/op / +0.6% (worse)
Windows MSVC BenchmarkChannelBuffered 29.880 ns/op -0.75 ns/op / -2.4% (better)
Windows MSVC BenchmarkChannelHandoff 770.800 ns/op +59 ns/op / +8.3% (worse)
Windows MSVC BenchmarkDefer 32.360 ns/op -0.63 ns/op / -1.9% (better)
Windows MSVC BenchmarkDirectCall 0.946 ns/op -0.0343 ns/op / -3.5% (better)
Windows MSVC BenchmarkGlobalRead 0.937 ns/op -0.0446 ns/op / -4.5% (better)
Windows MSVC BenchmarkGlobalWrite 4.692 ns/op -0.189 ns/op / -3.9% (better)
Windows MSVC BenchmarkGoroutine 37217 ns/op -532 ns/op / -1.4% (better)
Windows MSVC BenchmarkInterfaceCall 4.755 ns/op -0.164 ns/op / -3.3% (better)
Windows MSVC BenchmarkRuntimeGetG 0.981 ns/op -0.0175 ns/op / -1.8% (better)
Windows MSVC 386 BenchmarkLookupPCRandom 26.590 ns/op -0.06 ns/op / -0.2% (better)
Windows MSVC 386 BenchmarkMergeCompilerFlags 780.800 ns/op +1.7 ns/op / +0.2% (worse)
Windows MSVC 386 BenchmarkMergeLinkerFlags 694.800 ns/op +4.9 ns/op / +0.7% (worse)
Windows MSVC 386 BenchmarkChannelBuffered 39.090 ns/op -0.54 ns/op / -1.4% (better)
Windows MSVC 386 BenchmarkChannelHandoff 888.300 ns/op -23.3 ns/op / -2.6% (better)
Windows MSVC 386 BenchmarkDefer 49.580 ns/op -4.21 ns/op / -7.8% (better)
Windows MSVC 386 BenchmarkDirectCall 1.546 ns/op -0.079 ns/op / -4.9% (better)
Windows MSVC 386 BenchmarkGlobalRead 1.552 ns/op -0.005 ns/op / -0.3% (better)
Windows MSVC 386 BenchmarkGlobalWrite 7.782 ns/op -0.163 ns/op / -2.1% (better)
Windows MSVC 386 BenchmarkGoroutine 92553 ns/op +148 ns/op / +0.2% (worse)
Windows MSVC 386 BenchmarkInterfaceCall 8.372 ns/op -0.558 ns/op / -6.2% (better)
Windows MSVC 386 BenchmarkRuntimeGetG 2.170 ns/op -0.006 ns/op / -0.3% (better)
Windows MSVC ARM64 BenchmarkLookupPCRandom 12.030 ns/op +0.01 ns/op / +0.1% (worse)
Windows MSVC ARM64 BenchmarkMergeCompilerFlags 569 ns/op -9.9 ns/op / -1.7% (better)
Windows MSVC ARM64 BenchmarkMergeLinkerFlags 535.200 ns/op -8.4 ns/op / -1.5% (better)
Windows MSVC ARM64 BenchmarkChannelBuffered 37.990 ns/op -0.08 ns/op / -0.2% (better)
Windows MSVC ARM64 BenchmarkChannelHandoff 2491 ns/op +232 ns/op / +10.3% (worse)
Windows MSVC ARM64 BenchmarkDefer 64.890 ns/op +1.96 ns/op / +3.1% (worse)
Windows MSVC ARM64 BenchmarkDirectCall 0.663 ns/op 0 ns/op / +0.0%
Windows MSVC ARM64 BenchmarkGlobalRead 0.590 ns/op -0.0003 ns/op / -0.1% (better)
Windows MSVC ARM64 BenchmarkGlobalWrite 3.756 ns/op 0 ns/op / +0.0%
Windows MSVC ARM64 BenchmarkGoroutine 56934 ns/op +1586 ns/op / +2.9% (worse)
Windows MSVC ARM64 BenchmarkInterfaceCall 4.239 ns/op -0.003 ns/op / -0.1% (better)
Windows MSVC ARM64 BenchmarkRuntimeGetG 1.799 ns/op -0.002 ns/op / -0.1% (better)
Timer runtime benchmarks
Platform Operation and runtime ns/op vs base
Linux AfterFuncZeroDelivery/Go 937.700 ns/op +28 ns/op / +3.1% (worse)
Linux AfterFuncZeroDelivery/LLGo 48964 ns/op +16736 ns/op / +51.9% (worse)
Linux CreateStop/Go 313.700 ns/op +19.5 ns/op / +6.6% (worse)
Linux CreateStop/LLGo 1734 ns/op -32 ns/op / -1.8% (better)
Linux RearmStopped/Go 116.800 ns/op +1.4 ns/op / +1.2% (worse)
Linux RearmStopped/LLGo 1301 ns/op +10 ns/op / +0.8% (worse)
Linux ResetActive/Go 68.950 ns/op +1.37 ns/op / +2.0% (worse)
Linux ResetActive/LLGo 650.500 ns/op +46.5 ns/op / +7.7% (worse)
Linux ResetHeap1024/Go 67.590 ns/op +0.24 ns/op / +0.4% (worse)
Linux ResetHeap1024/LLGo 179.500 ns/op +2.6 ns/op / +1.5% (worse)
macOS AfterFuncZeroDelivery/Go 555.500 ns/op +13.4 ns/op / +2.5% (worse)
macOS AfterFuncZeroDelivery/LLGo 90059 ns/op -1421 ns/op / -1.6% (better)
macOS CreateStop/Go 217.300 ns/op +30.9 ns/op / +16.6% (worse)
macOS CreateStop/LLGo 871.300 ns/op -47.8 ns/op / -5.2% (better)
macOS RearmStopped/Go 69.140 ns/op -10.27 ns/op / -12.9% (better)
macOS RearmStopped/LLGo 564.300 ns/op -186.7 ns/op / -24.9% (better)
macOS ResetActive/Go 52.010 ns/op -11.82 ns/op / -18.5% (better)
macOS ResetActive/LLGo 200.900 ns/op -97.1 ns/op / -32.6% (better)
macOS ResetHeap1024/Go 49.680 ns/op -3.97 ns/op / -7.4% (better)
macOS ResetHeap1024/LLGo 87.090 ns/op -38.31 ns/op / -30.6% (better)
Windows MinGW AfterFuncZeroDelivery/Go 368.700 ns/op -5.5 ns/op / -1.5% (better)
Windows MinGW AfterFuncZeroDelivery/LLGo 99291 ns/op -7994 ns/op / -7.5% (better)
Windows MinGW CreateStop/Go 89.640 ns/op +0.07 ns/op / +0.1% (worse)
Windows MinGW CreateStop/LLGo 338.400 ns/op -106.1 ns/op / -23.9% (better)
Windows MinGW RearmStopped/Go 24.470 ns/op +0.01 ns/op / +0.04088% (worse)
Windows MinGW RearmStopped/LLGo 218.200 ns/op -74.5 ns/op / -25.5% (better)
Windows MinGW ResetActive/Go 14.780 ns/op -0.03 ns/op / -0.2% (better)
Windows MinGW ResetActive/LLGo 127.500 ns/op +7.1 ns/op / +5.9% (worse)
Windows MinGW ResetHeap1024/Go 14.780 ns/op -0.1 ns/op / -0.7% (better)
Windows MinGW ResetHeap1024/LLGo 103.700 ns/op -2.4 ns/op / -2.3% (better)
Windows MinGW 386 AfterFuncZeroDelivery/Go 780.800 ns/op +17.7 ns/op / +2.3% (worse)
Windows MinGW 386 AfterFuncZeroDelivery/LLGo 125072 ns/op +3665 ns/op / +3.0% (worse)
Windows MinGW 386 CreateStop/Go 170.700 ns/op +2.6 ns/op / +1.5% (worse)
Windows MinGW 386 CreateStop/LLGo 403.600 ns/op +27.6 ns/op / +7.3% (worse)
Windows MinGW 386 RearmStopped/Go 56.680 ns/op -0.14 ns/op / -0.2% (better)
Windows MinGW 386 RearmStopped/LLGo 275.300 ns/op +6.7 ns/op / +2.5% (worse)
Windows MinGW 386 ResetActive/Go 32.580 ns/op +0.02 ns/op / +0.1% (worse)
Windows MinGW 386 ResetActive/LLGo 208.300 ns/op -698.7 ns/op / -77.0% (better)
Windows MinGW 386 ResetHeap1024/Go 32.920 ns/op +0.12 ns/op / +0.4% (worse)
Windows MinGW 386 ResetHeap1024/LLGo 149.200 ns/op +1.2 ns/op / +0.8% (worse)
Windows MinGW ARM64 AfterFuncZeroDelivery/Go 657 ns/op -18.9 ns/op / -2.8% (better)
Windows MinGW ARM64 AfterFuncZeroDelivery/LLGo 136568 ns/op -2112 ns/op / -1.5% (better)
Windows MinGW ARM64 CreateStop/Go 192.100 ns/op -8 ns/op / -4.0% (better)
Windows MinGW ARM64 CreateStop/LLGo 359 ns/op -2.8 ns/op / -0.8% (better)
Windows MinGW ARM64 RearmStopped/Go 70.580 ns/op 0 ns/op / +0.0%
Windows MinGW ARM64 RearmStopped/LLGo 255.600 ns/op -1.5 ns/op / -0.6% (better)
Windows MinGW ARM64 ResetActive/Go 31.080 ns/op +0.15 ns/op / +0.5% (worse)
Windows MinGW ARM64 ResetActive/LLGo 130.500 ns/op -4.9 ns/op / -3.6% (better)
Windows MinGW ARM64 ResetHeap1024/Go 31.100 ns/op +0.07 ns/op / +0.2% (worse)
Windows MinGW ARM64 ResetHeap1024/LLGo 126.800 ns/op -0.6 ns/op / -0.5% (better)
Windows MSVC AfterFuncZeroDelivery/Go 426 ns/op -15.5 ns/op / -3.5% (better)
Windows MSVC AfterFuncZeroDelivery/LLGo 81559 ns/op -2546 ns/op / -3.0% (better)
Windows MSVC CreateStop/Go 123 ns/op -4.9 ns/op / -3.8% (better)
Windows MSVC CreateStop/LLGo 324.300 ns/op -35.5 ns/op / -9.9% (better)
Windows MSVC RearmStopped/Go 48.450 ns/op -1.34 ns/op / -2.7% (better)
Windows MSVC RearmStopped/LLGo 198.100 ns/op -1.5 ns/op / -0.8% (better)
Windows MSVC ResetActive/Go 21.460 ns/op -0.55 ns/op / -2.5% (better)
Windows MSVC ResetActive/LLGo 607.200 ns/op +114.5 ns/op / +23.2% (worse)
Windows MSVC ResetHeap1024/Go 21.220 ns/op -0.66 ns/op / -3.0% (better)
Windows MSVC ResetHeap1024/LLGo 96.200 ns/op -0.36 ns/op / -0.4% (better)
Windows MSVC 386 AfterFuncZeroDelivery/Go 962.300 ns/op +7.3 ns/op / +0.8% (worse)
Windows MSVC 386 AfterFuncZeroDelivery/LLGo 197993 ns/op -2195 ns/op / -1.1% (better)
Windows MSVC 386 CreateStop/Go 196.900 ns/op +0.9 ns/op / +0.5% (worse)
Windows MSVC 386 CreateStop/LLGo 474.900 ns/op -17.3 ns/op / -3.5% (better)
Windows MSVC 386 RearmStopped/Go 63.680 ns/op -0.06 ns/op / -0.1% (better)
Windows MSVC 386 RearmStopped/LLGo 323.200 ns/op -10.1 ns/op / -3.0% (better)
Windows MSVC 386 ResetActive/Go 39.250 ns/op +0.07 ns/op / +0.2% (worse)
Windows MSVC 386 ResetActive/LLGo 869.900 ns/op -80.3 ns/op / -8.5% (better)
Windows MSVC 386 ResetHeap1024/Go 39.620 ns/op +0.09 ns/op / +0.2% (worse)
Windows MSVC 386 ResetHeap1024/LLGo 172.800 ns/op +2 ns/op / +1.2% (worse)
Windows MSVC ARM64 AfterFuncZeroDelivery/Go 654.600 ns/op -8.4 ns/op / -1.3% (better)
Windows MSVC ARM64 AfterFuncZeroDelivery/LLGo 152603 ns/op +24054 ns/op / +18.7% (worse)
Windows MSVC ARM64 CreateStop/Go 195.800 ns/op -1.1 ns/op / -0.6% (better)
Windows MSVC ARM64 CreateStop/LLGo 399.400 ns/op +3.5 ns/op / +0.9% (worse)
Windows MSVC ARM64 RearmStopped/Go 70.640 ns/op +0.07 ns/op / +0.1% (worse)
Windows MSVC ARM64 RearmStopped/LLGo 274.100 ns/op -0.1 ns/op / -0.03647% (better)
Windows MSVC ARM64 ResetActive/Go 31.180 ns/op +0.02 ns/op / +0.1% (worse)
Windows MSVC ARM64 ResetActive/LLGo 144.200 ns/op +14.4 ns/op / +11.1% (worse)
Windows MSVC ARM64 ResetHeap1024/Go 31.160 ns/op -0.01 ns/op / -0.03208% (better)
Windows MSVC ARM64 ResetHeap1024/LLGo 137 ns/op -0.6 ns/op / -0.4% (better)

Compared with 943120d1a365 measured in the same runner job.

@zhouguangyuan0718
zhouguangyuan0718 force-pushed the codex/type-conversion-query-20260918 branch 2 times, most recently from 563d7da to 49aa4e5 Compare September 20, 2026 16:25
@xushiwei
xushiwei merged commit 81a4d03 into xgo-dev:main Sep 21, 2026
62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants