Skip to content

fix(test): match Go output buffering and JSON streaming - #2724

Merged
xushiwei merged 4 commits into
xgo-dev:mainfrom
cpunion:codex/fix-test-output-go-compat-20261003
Oct 4, 2026
Merged

xushiwei merged 4 commits into
xgo-dev:mainfrom
cpunion:codex/fix-test-output-go-compat-20261003

Conversation

@cpunion

@cpunion cpunion commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

Align llgo test output buffering and streaming with go test.

Scenario go test llgo test If a test loops forever
No package arguments Stream stdout/stderr immediately Same as Go Output printed before the loop remains visible
-v ./pkg (one package) Stream verbose output immediately Same as Go === RUN and earlier logs remain visible
-v -p=1 ./... Stream immediately; run packages sequentially Same as Go Earlier logs remain visible; later packages wait
-v ./... (multiple packages in parallel) Buffer per package; print in package order Same as Go The hung package's logs stay buffered; later packages' output may also wait
-json ./... Stream JSON events with package attribution Same as Go Earlier events and output from other running packages remain visible
Explicit package list, no -v / -json / -bench / -fuzz Buffer output; show only summaries on success, full output on failure Same as Go No progress output until the package exits or times out
-bench / -fuzz Stream immediately Same as Go Earlier output remains visible
-list Stream for one package or -p=1; otherwise buffer per package Same as Go Test bodies are not executed
-timeout Default: 10m; 0 disables the test timeout Same as Go Buffered logs become available when the timeout ends the process; -timeout=0 may leave them hidden indefinitely

Single-package output follows the same Go policy:

Command (same flags for go test) Output in both Go and LLGo If a test loops forever
llgo test (no package argument) Stream stdout/stderr immediately; t.Log needs -v Earlier stdout/stderr remains visible
llgo test ./pkg Buffer; show only a summary on success, full output on failure Logs remain buffered until exit or timeout
llgo test -v ./pkg Stream test progress and logs immediately === RUN and earlier logs remain visible
llgo test -json ./pkg Stream JSON events immediately Earlier events remain visible

@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: Go-compatible test output

Solid, well-tested rework. The new testOutputPolicy cleanly mirrors cmd/go's local-directory vs. package-list output modes, the test2json converter is a faithful upstream vendor with correct BSD attribution/LICENSE, and the package-ordered reporter is covered by targeted tests. I specifically investigated the main risk and found it not present:

  • No data race in testResultReporter. The stateful closure (results/ready/next) is only ever touched on the serialized scheduler goroutine. In test_dag.go, report(...) is invoked only from skipped/blocked/complete, all of which run on the single main loop; worker goroutines only run run, and runResults[rootIndex] is ordered through the completion channel (happens-before). In run.go runTestPrograms, report is called only from the collection loop. Writes to the shared stdout are serialized via lockedTestWriter.
  • Correctness verified: testJSONArgs normalization (stops at --, no caller-slice mutation, no duplicate -test.v), the build.go emulator-test refactor (compile-only path still no-ops via runInEmulator; executed emulator tests now join the batch), the \x16 FAIL-line prefix being consumed only inside a converter, and injection-safe exec.Command arg passing.

Notes (non-blocking)

  • One inline comment below: a wasted full-output buffer copy in JSON mode (the only concrete issue in the PR's own new code).
  • Memory characteristic (informational): in buffered/package-ordered mode, output of completed-but-not-yet-flushed packages stays resident until the head-of-line package finishes. This matches cmd/go in-order printing semantics, so it's by design — just worth awareness under skewed package durations with large output.
  • internal/test2json/test2json.go carries two inaccurate doc annotations copied verbatim from upstream Go: the NewConverter comment says framing is prefixed with ^V (\x22) (should be \x16) and references a ModeTime constant that is actually named Timestamp. Comment-only, no behavioral impact; left to you whether to diverge from upstream for a faithful-vendor sync.

No blocking issues.

Comment thread internal/build/test_output.go Outdated
@codecov

codecov Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.30942% with 12 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/test2json/test2json.go 97.17% 7 Missing ⚠️
internal/build/run.go 88.46% 3 Missing ⚠️
internal/build/coverage_run.go 92.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

LLGo WebAssembly build benchmarks

ef30d3467dc3 | 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 154193 B 0 B / +0.0% 88742 B 0 B / +0.0%
cprintf/j32-goos-js/LLGo 152295 B 0 B / +0.0% 73165 B 0 B / +0.0%
cprintf/j64-emscripten-memory64/LLGo 141248 B 0 B / +0.0% 92630 B 0 B / +0.0%
cprintf/w32-goos-wasip1/LLGo 152848 B 0 B / +0.0% 0 B 0 B / 0.0%
cprintf/w32-wasi/LLGo 153560 B 0 B / +0.0% 0 B 0 B / 0.0%
fmtprintf/j32-emscripten/LLGo 3213561 B 0 B / +0.0% 132442 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 3192660 B 0 B / +0.0% 101635 B 0 B / +0.0%
fmtprintf/j64-emscripten-memory64/LLGo 2950168 B 0 B / +0.0% 139285 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 2347479 B 0 B / +0.0% 0 B 0 B / 0.0%
fmtprintf/w32-wasi/LLGo 2344141 B 0 B / +0.0% 0 B 0 B / 0.0%
j32-emscripten/LLGo 153428 B 0 B / +0.0% 88742 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 151768 B 0 B / +0.0% 73165 B 0 B / +0.0%
j64-emscripten-memory64/LLGo 140582 B 0 B / +0.0% 92630 B 0 B / +0.0%
reflectcall/j32-emscripten/LLGo 1543898 B 0 B / +0.0% 105908 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 1546371 B 0 B / +0.0% 90331 B 0 B / +0.0%
reflectcall/j64-emscripten-memory64/LLGo 1428570 B 0 B / +0.0% 111641 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 1276821 B 0 B / +0.0% 0 B 0 B / 0.0%
reflectcall/w32-wasi/LLGo 1274429 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 152495 B 0 B / +0.0% 0 B 0 B / 0.0%
w32-wasi/LLGo 153207 B 0 B / +0.0% 0 B 0 B / 0.0%
LLGo WebAssembly build measurements
Example and profile Build vs base
j32-emscripten 6.291 s +91.18 ms / +1.5% (worse)
j32-goos-js 6.056 s +141.8 ms / +2.4% (worse)
j64-emscripten-memory64 5.272 s +31.9 ms / +0.6% (worse)
reflectcall/w32-wasi 23.195 s -546.1 ms / -2.3% (better)
w32-goos-wasip1 4.289 s -19.75 ms / -0.5% (better)
w32-wasi 4.053 s +58.16 ms / +1.5% (worse)

Compared with 783ec4fd3d57 measured in the same runner job.

@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown

LLGo baseline benchmarks

ef30d3467dc3 | 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 8568 B 0 B / +0.0% 387 B 0 B / +0.0% 919.939 ms -16.02 ms / -1.7% (better) 1.279 ms +69.2 us / +5.7% (worse)
Linux cprintf-lto 8408 B 0 B / +0.0% 368 B 0 B / +0.0% 929.834 ms -503 us / -0.1% (better) 1.246 ms +29.85 us / +2.5% (worse)
Linux fmtprintf 4880952 B +8 B / +0.0001639% (worse) 501619 B 0 B / +0.0% 7.357 s +93.13 ms / +1.3% (worse) 3.008 ms +18.08 us / +0.6% (worse)
Linux fmtprintf-lto 3600808 B 0 B / +0.0% 438538 B 0 B / +0.0% 16.167 s -15.58 ms / -0.1% (better) 3.090 ms +93.45 us / +3.1% (worse)
Linux println 674952 B 0 B / +0.0% 16855 B 0 B / +0.0% 996.860 ms +59.74 ms / +6.4% (worse) 1.622 ms +52.78 us / +3.4% (worse)
Linux println-lto 190024 B 0 B / +0.0% 14273 B 0 B / +0.0% 1.235 s -41.04 ms / -3.2% (better) 1.622 ms +35.75 us / +2.3% (worse)
macOS cprintf 50736 B 0 B / +0.0% 4409 B 0 B / +0.0% 959.833 ms +42.56 ms / +4.6% (worse) 5.683 ms +3.237 ms / +132.4% (worse)
macOS cprintf-lto 50496 B 0 B / +0.0% 161 B 0 B / +0.0% 903.644 ms -240.9 ms / -21.0% (better) 2.347 ms -830.4 us / -26.1% (better)
macOS fmtprintf 1773456 B 0 B / +0.0% 877780 B 0 B / +0.0% 4.616 s -186.3 ms / -3.9% (better) 8.466 ms -490.5 us / -5.5% (better)
macOS fmtprintf-lto 1360928 B 0 B / +0.0% 762428 B 0 B / +0.0% 10.379 s +423 ms / +4.2% (worse) 5.828 ms +427 us / +7.9% (worse)
macOS println 99344 B 0 B / +0.0% 24216 B 0 B / +0.0% 935.817 ms -157.1 ms / -14.4% (better) 4.460 ms +488.7 us / +12.3% (worse)
macOS println-lto 83664 B 0 B / +0.0% 21457 B 0 B / +0.0% 1.128 s -20.73 ms / -1.8% (better) 5.630 ms +1.726 ms / +44.2% (worse)
Windows MinGW cprintf 651264 B 0 B / +0.0% 4550 B 0 B / +0.0% 1.676 s +40.6 ms / +2.5% (worse) 4.063 ms +118.4 us / +3.0% (worse)
Windows MinGW cprintf-lto 43520 B 0 B / +0.0% 4486 B 0 B / +0.0% 1.718 s +21.86 ms / +1.3% (worse) 3.600 ms -510.2 us / -12.4% (better)
Windows MinGW fmtprintf 5432832 B 0 B / +0.0% 600310 B 0 B / +0.0% 7.214 s +84.75 ms / +1.2% (worse) 9.310 ms +682.1 us / +7.9% (worse)
Windows MinGW fmtprintf-lto 4127232 B 0 B / +0.0% 546582 B 0 B / +0.0% 14.797 s +415.7 ms / +2.9% (worse) 8.523 ms +105.7 us / +1.3% (worse)
Windows MinGW println 706560 B 0 B / +0.0% 25190 B 0 B / +0.0% 1.671 s +26.22 ms / +1.6% (worse) 7.732 ms +663.6 us / +9.4% (worse)
Windows MinGW println-lto 208896 B 0 B / +0.0% 22054 B 0 B / +0.0% 1.955 s +38.35 ms / +2.0% (worse) 7.317 ms +15.6 us / +0.2% (worse)
Windows MinGW 386 cprintf 601600 B 0 B / +0.0% 5326 B 0 B / +0.0% 1.226 s -33.81 ms / -2.7% (better) 3.206 ms -253.2 us / -7.3% (better)
Windows MinGW 386 cprintf-lto 103424 B 0 B / +0.0% 5094 B 0 B / +0.0% 1.247 s -112 ms / -8.2% (better) 3.647 ms +502 us / +16.0% (worse)
Windows MinGW 386 fmtprintf 4745216 B 0 B / +0.0% 472478 B 0 B / +0.0% 6.185 s +440.6 ms / +7.7% (worse) 6.537 ms -955.2 us / -12.7% (better)
Windows MinGW 386 fmtprintf-lto 4148736 B 0 B / +0.0% 451114 B 0 B / +0.0% 11.102 s -617.4 ms / -5.3% (better) 6.349 ms -211.4 us / -3.2% (better)
Windows MinGW 386 println 653312 B 0 B / +0.0% 21490 B 0 B / +0.0% 1.442 s +254.1 ms / +21.4% (worse) 6.241 ms +412 us / +7.1% (worse)
Windows MinGW 386 println-lto 258560 B 0 B / +0.0% 19306 B 0 B / +0.0% 1.500 s -297.9 ms / -16.6% (better) 5.362 ms -738 us / -12.1% (better)
Windows MinGW ARM64 cprintf 661504 B 0 B / +0.0% 4408 B 0 B / +0.0% 1.863 s -57.8 ms / -3.0% (better) 5.944 ms -995.7 us / -14.3% (better)
Windows MinGW ARM64 cprintf-lto 43520 B 0 B / +0.0% 4340 B 0 B / +0.0% 1.880 s -48.74 ms / -2.5% (better) 6.725 ms -89 us / -1.3% (better)
Windows MinGW ARM64 fmtprintf 5343744 B 0 B / +0.0% 510876 B 0 B / +0.0% 7.251 s +389.3 ms / +5.7% (worse) 13.618 ms +1.683 ms / +14.1% (worse)
Windows MinGW ARM64 fmtprintf-lto 4302336 B 0 B / +0.0% 477264 B 0 B / +0.0% 13.614 s -129.9 ms / -0.9% (better) 11.963 ms +315.5 us / +2.7% (worse)
Windows MinGW ARM64 println 714240 B 0 B / +0.0% 23884 B 0 B / +0.0% 1.849 s -47.76 ms / -2.5% (better) 10.139 ms -239.9 us / -2.3% (better)
Windows MinGW ARM64 println-lto 215552 B 0 B / +0.0% 21232 B 0 B / +0.0% 2.088 s -57.13 ms / -2.7% (better) 10.415 ms -1.282 ms / -11.0% (better)
Windows MSVC cprintf 893952 B 0 B / +0.0% 65798 B 0 B / +0.0% 1.557 s +30.46 ms / +2.0% (worse) 3.952 ms +7.6 us / +0.2% (worse)
Windows MSVC cprintf-lto 289792 B 0 B / +0.0% 65734 B 0 B / +0.0% 1.563 s +11.06 ms / +0.7% (worse) 4.091 ms +321.9 us / +8.5% (worse)
Windows MSVC fmtprintf 5732864 B 0 B / +0.0% 695862 B 0 B / +0.0% 6.900 s -30.48 ms / -0.4% (better) 10.424 ms -386.8 us / -3.6% (better)
Windows MSVC fmtprintf-lto 4449792 B 0 B / +0.0% 646134 B 0 B / +0.0% 13.815 s +71.57 ms / +0.5% (worse) 9.486 ms -919.9 us / -8.8% (better)
Windows MSVC println 1017344 B 0 B / +0.0% 120854 B 0 B / +0.0% 1.546 s +14.1 ms / +0.9% (worse) 7.638 ms -740.5 us / -8.8% (better)
Windows MSVC println-lto 528384 B 0 B / +0.0% 118390 B 0 B / +0.0% 1.817 s -16.74 ms / -0.9% (better) 9.001 ms +659.5 us / +7.9% (worse)
Windows MSVC 386 cprintf 513536 B 0 B / +0.0% 3931 B 0 B / +0.0% 1.433 s -140.3 ms / -8.9% (better) 3.605 ms -1.315 ms / -26.7% (better)
Windows MSVC 386 cprintf-lto 44032 B 0 B / +0.0% 3853 B 0 B / +0.0% 1.273 s -97.26 ms / -7.1% (better) 3.444 ms -274.6 us / -7.4% (better)
Windows MSVC 386 fmtprintf 4479488 B 0 B / +0.0% 455868 B 0 B / +0.0% 6.494 s +498.1 ms / +8.3% (worse) 8.504 ms +167.6 us / +2.0% (worse)
Windows MSVC 386 fmtprintf-lto 3899392 B 0 B / +0.0% 426651 B 0 B / +0.0% 10.836 s -55.4 ms / -0.5% (better) 8.363 ms -2.851 ms / -25.4% (better)
Windows MSVC 386 println 567296 B 0 B / +0.0% 20340 B 0 B / +0.0% 1.479 s +149.8 ms / +11.3% (worse) 6.536 ms -1.093 ms / -14.3% (better)
Windows MSVC 386 println-lto 199168 B 0 B / +0.0% 18501 B 0 B / +0.0% 1.768 s +164.4 ms / +10.3% (worse) 6.264 ms -1.497 ms / -19.3% (better)
Windows MSVC ARM64 cprintf 662528 B 0 B / +0.0% 4192 B 0 B / +0.0% 1.589 s +38.84 ms / +2.5% (worse) 6.771 ms +685.4 us / +11.3% (worse)
Windows MSVC ARM64 cprintf-lto 47616 B 0 B / +0.0% 4084 B 0 B / +0.0% 1.614 s +52.91 ms / +3.4% (worse) 6.697 ms +252.4 us / +3.9% (worse)
Windows MSVC ARM64 fmtprintf 5339648 B 0 B / +0.0% 510808 B 0 B / +0.0% 6.592 s -20.45 ms / -0.3% (better) 14.600 ms +1.579 ms / +12.1% (worse)
Windows MSVC ARM64 fmtprintf-lto 4309504 B 0 B / +0.0% 477924 B 0 B / +0.0% 12.931 s +370.6 ms / +3.0% (worse) 14.272 ms +755.1 us / +5.6% (worse)
Windows MSVC ARM64 println 715264 B 0 B / +0.0% 23908 B 0 B / +0.0% 1.586 s +28.87 ms / +1.9% (worse) 12.342 ms +456.4 us / +3.8% (worse)
Windows MSVC ARM64 println-lto 220672 B 0 B / +0.0% 21380 B 0 B / +0.0% 1.801 s -7.707 ms / -0.4% (better) 11.883 ms +453.6 us / +4.0% (worse)
Core language and compiler benchmarks
Platform Benchmark ns/op vs base
Linux BenchmarkLookupPCRandom 14.560 ns/op +0.16 ns/op / +1.1% (worse)
Linux BenchmarkMergeCompilerFlags 199.500 ns/op -9.1 ns/op / -4.4% (better)
Linux BenchmarkMergeLinkerFlags 125.900 ns/op +0.7 ns/op / +0.6% (worse)
Linux BenchmarkChannelBuffered 55.480 ns/op +0.27 ns/op / +0.5% (worse)
Linux BenchmarkChannelHandoff 12968 ns/op +203 ns/op / +1.6% (worse)
Linux BenchmarkDefer 48.230 ns/op +1.03 ns/op / +2.2% (worse)
Linux BenchmarkDirectCall 1.209 ns/op +0.043 ns/op / +3.7% (worse)
Linux BenchmarkGlobalRead 1.172 ns/op +0.008 ns/op / +0.7% (worse)
Linux BenchmarkGlobalWrite 7.765 ns/op +0.007 ns/op / +0.1% (worse)
Linux BenchmarkGoroutine 23790 ns/op -790 ns/op / -3.2% (better)
Linux BenchmarkInterfaceCall 6.376 ns/op +0.544 ns/op / +9.3% (worse)
Linux BenchmarkRuntimeGetG 3.028 ns/op +0.008 ns/op / +0.3% (worse)
macOS BenchmarkLookupPCRandom 11.370 ns/op -0.96 ns/op / -7.8% (better)
macOS BenchmarkMergeCompilerFlags 84.810 ns/op -21.19 ns/op / -20.0% (better)
macOS BenchmarkMergeLinkerFlags 54.160 ns/op -13.01 ns/op / -19.4% (better)
macOS BenchmarkChannelBuffered 24.650 ns/op -0.94 ns/op / -3.7% (better)
macOS BenchmarkChannelHandoff 6800 ns/op +675 ns/op / +11.0% (worse)
macOS BenchmarkDefer 30.840 ns/op -13 ns/op / -29.7% (better)
macOS BenchmarkDirectCall 0.960 ns/op -0.0681 ns/op / -6.6% (better)
macOS BenchmarkGlobalRead 1.076 ns/op +0.008 ns/op / +0.7% (worse)
macOS BenchmarkGlobalWrite 1.129 ns/op +0.069 ns/op / +6.5% (worse)
macOS BenchmarkGoroutine 36492 ns/op +637 ns/op / +1.8% (worse)
macOS BenchmarkInterfaceCall 3.459 ns/op -0.435 ns/op / -11.2% (better)
macOS BenchmarkRuntimeGetG 2.068 ns/op 0 ns/op / +0.0%
Windows MinGW BenchmarkLookupPCRandom 11.670 ns/op +0.08 ns/op / +0.7% (worse)
Windows MinGW BenchmarkMergeCompilerFlags 567.600 ns/op -10 ns/op / -1.7% (better)
Windows MinGW BenchmarkMergeLinkerFlags 518.300 ns/op +26.3 ns/op / +5.3% (worse)
Windows MinGW BenchmarkChannelBuffered 44.890 ns/op +0.72 ns/op / +1.6% (worse)
Windows MinGW BenchmarkChannelHandoff 1288 ns/op -210 ns/op / -14.0% (better)
Windows MinGW BenchmarkDefer 66.380 ns/op +6.6 ns/op / +11.0% (worse)
Windows MinGW BenchmarkDirectCall 1.152 ns/op +0.063 ns/op / +5.8% (worse)
Windows MinGW BenchmarkGlobalRead 1.056 ns/op -0.012 ns/op / -1.1% (better)
Windows MinGW BenchmarkGlobalWrite 8.597 ns/op +0.061 ns/op / +0.7% (worse)
Windows MinGW BenchmarkGoroutine 78625 ns/op -6636 ns/op / -7.8% (better)
Windows MinGW BenchmarkInterfaceCall 6.077 ns/op +0.044 ns/op / +0.7% (worse)
Windows MinGW BenchmarkRuntimeGetG 2.003 ns/op +0.042 ns/op / +2.1% (worse)
Windows MinGW 386 BenchmarkLookupPCRandom 15.710 ns/op -0.65 ns/op / -4.0% (better)
Windows MinGW 386 BenchmarkMergeCompilerFlags 994.300 ns/op +141.2 ns/op / +16.6% (worse)
Windows MinGW 386 BenchmarkMergeLinkerFlags 901.100 ns/op -88.7 ns/op / -9.0% (better)
Windows MinGW 386 BenchmarkChannelBuffered 34.780 ns/op -1.25 ns/op / -3.5% (better)
Windows MinGW 386 BenchmarkChannelHandoff 573.800 ns/op -13.9 ns/op / -2.4% (better)
Windows MinGW 386 BenchmarkDefer 26.050 ns/op -1.73 ns/op / -6.2% (better)
Windows MinGW 386 BenchmarkDirectCall 0.887 ns/op -0.0046 ns/op / -0.5% (better)
Windows MinGW 386 BenchmarkGlobalRead 0.888 ns/op -0.007 ns/op / -0.8% (better)
Windows MinGW 386 BenchmarkGlobalWrite 7.983 ns/op -0.023 ns/op / -0.3% (better)
Windows MinGW 386 BenchmarkGoroutine 51329 ns/op +2148 ns/op / +4.4% (worse)
Windows MinGW 386 BenchmarkInterfaceCall 4.441 ns/op -0.029 ns/op / -0.6% (better)
Windows MinGW 386 BenchmarkRuntimeGetG 0.934 ns/op -0.0015 ns/op / -0.2% (better)
Windows MinGW ARM64 BenchmarkLookupPCRandom 12.140 ns/op +0.08 ns/op / +0.7% (worse)
Windows MinGW ARM64 BenchmarkMergeCompilerFlags 580.600 ns/op +12.1 ns/op / +2.1% (worse)
Windows MinGW ARM64 BenchmarkMergeLinkerFlags 545.600 ns/op +13.4 ns/op / +2.5% (worse)
Windows MinGW ARM64 BenchmarkChannelBuffered 38.950 ns/op -0.54 ns/op / -1.4% (better)
Windows MinGW ARM64 BenchmarkChannelHandoff 1767 ns/op +329 ns/op / +22.9% (worse)
Windows MinGW ARM64 BenchmarkDefer 55.780 ns/op +3.74 ns/op / +7.2% (worse)
Windows MinGW ARM64 BenchmarkDirectCall 0.663 ns/op -0.0001 ns/op / -0.01507% (better)
Windows MinGW ARM64 BenchmarkGlobalRead 0.664 ns/op +0.0004 ns/op / +0.1% (worse)
Windows MinGW ARM64 BenchmarkGlobalWrite 0.739 ns/op +0.0022 ns/op / +0.3% (worse)
Windows MinGW ARM64 BenchmarkGoroutine 59913 ns/op +511 ns/op / +0.9% (worse)
Windows MinGW ARM64 BenchmarkInterfaceCall 4.144 ns/op 0 ns/op / +0.0%
Windows MinGW ARM64 BenchmarkRuntimeGetG 1.784 ns/op +0.014 ns/op / +0.8% (worse)
Windows MSVC BenchmarkLookupPCRandom 11.640 ns/op -0.09 ns/op / -0.8% (better)
Windows MSVC BenchmarkMergeCompilerFlags 553.900 ns/op -22.4 ns/op / -3.9% (better)
Windows MSVC BenchmarkMergeLinkerFlags 495.300 ns/op -14.1 ns/op / -2.8% (better)
Windows MSVC BenchmarkChannelBuffered 44.370 ns/op -5.01 ns/op / -10.1% (better)
Windows MSVC BenchmarkChannelHandoff 1792 ns/op +955.2 ns/op / +114.1% (worse)
Windows MSVC BenchmarkDefer 56.460 ns/op -6.75 ns/op / -10.7% (better)
Windows MSVC BenchmarkDirectCall 1.240 ns/op -0.008 ns/op / -0.6% (better)
Windows MSVC BenchmarkGlobalRead 1.067 ns/op -0.071 ns/op / -6.2% (better)
Windows MSVC BenchmarkGlobalWrite 8.711 ns/op +0.018 ns/op / +0.2% (worse)
Windows MSVC BenchmarkGoroutine 78140 ns/op +1373 ns/op / +1.8% (worse)
Windows MSVC BenchmarkInterfaceCall 6.682 ns/op -0.676 ns/op / -9.2% (better)
Windows MSVC BenchmarkRuntimeGetG 1.982 ns/op 0 ns/op / +0.0%
Windows MSVC 386 BenchmarkLookupPCRandom 15.600 ns/op +0.23 ns/op / +1.5% (worse)
Windows MSVC 386 BenchmarkMergeCompilerFlags 1068 ns/op +311.4 ns/op / +41.2% (worse)
Windows MSVC 386 BenchmarkMergeLinkerFlags 1017 ns/op +376.9 ns/op / +58.9% (worse)
Windows MSVC 386 BenchmarkChannelBuffered 35.030 ns/op +0.19 ns/op / +0.5% (worse)
Windows MSVC 386 BenchmarkChannelHandoff 576.900 ns/op +68.1 ns/op / +13.4% (worse)
Windows MSVC 386 BenchmarkDefer 27.520 ns/op +0.92 ns/op / +3.5% (worse)
Windows MSVC 386 BenchmarkDirectCall 0.901 ns/op -0.0091 ns/op / -1.0% (better)
Windows MSVC 386 BenchmarkGlobalRead 0.892 ns/op +0.0009 ns/op / +0.1% (worse)
Windows MSVC 386 BenchmarkGlobalWrite 8.004 ns/op -0.026 ns/op / -0.3% (better)
Windows MSVC 386 BenchmarkGoroutine 52740 ns/op -2718 ns/op / -4.9% (better)
Windows MSVC 386 BenchmarkInterfaceCall 4.648 ns/op +0.132 ns/op / +2.9% (worse)
Windows MSVC 386 BenchmarkRuntimeGetG 0.942 ns/op +0.0031 ns/op / +0.3% (worse)
Windows MSVC ARM64 BenchmarkLookupPCRandom 12.090 ns/op 0 ns/op / +0.0%
Windows MSVC ARM64 BenchmarkMergeCompilerFlags 576.600 ns/op -2.1 ns/op / -0.4% (better)
Windows MSVC ARM64 BenchmarkMergeLinkerFlags 531 ns/op -9.5 ns/op / -1.8% (better)
Windows MSVC ARM64 BenchmarkChannelBuffered 38.590 ns/op +1.04 ns/op / +2.8% (worse)
Windows MSVC ARM64 BenchmarkChannelHandoff 1801 ns/op -190 ns/op / -9.5% (better)
Windows MSVC ARM64 BenchmarkDefer 62.310 ns/op +0.74 ns/op / +1.2% (worse)
Windows MSVC ARM64 BenchmarkDirectCall 0.663 ns/op +0.0001 ns/op / +0.01507% (worse)
Windows MSVC ARM64 BenchmarkGlobalRead 0.663 ns/op -0.0004 ns/op / -0.1% (better)
Windows MSVC ARM64 BenchmarkGlobalWrite 3.801 ns/op +0.005 ns/op / +0.1% (worse)
Windows MSVC ARM64 BenchmarkGoroutine 58569 ns/op +751 ns/op / +1.3% (worse)
Windows MSVC ARM64 BenchmarkInterfaceCall 4.150 ns/op +0.007 ns/op / +0.2% (worse)
Windows MSVC ARM64 BenchmarkRuntimeGetG 1.769 ns/op -0.001 ns/op / -0.1% (better)
Timer runtime benchmarks
Platform Operation and runtime ns/op vs base
Linux AfterFuncZeroDelivery/Go 902.200 ns/op -15.7 ns/op / -1.7% (better)
Linux AfterFuncZeroDelivery/LLGo 35762 ns/op -1136 ns/op / -3.1% (better)
Linux CreateStop/Go 289.700 ns/op -0.9 ns/op / -0.3% (better)
Linux CreateStop/LLGo 1863 ns/op -34 ns/op / -1.8% (better)
Linux RearmStopped/Go 115.700 ns/op -0.2 ns/op / -0.2% (better)
Linux RearmStopped/LLGo 1195 ns/op +29 ns/op / +2.5% (worse)
Linux ResetActive/Go 68.580 ns/op -0.1 ns/op / -0.1% (better)
Linux ResetActive/LLGo 869.200 ns/op +0.5 ns/op / +0.1% (worse)
Linux ResetHeap1024/Go 67.070 ns/op -0.05 ns/op / -0.1% (better)
Linux ResetHeap1024/LLGo 173.900 ns/op -2.5 ns/op / -1.4% (better)
macOS AfterFuncZeroDelivery/Go 364.700 ns/op -74.8 ns/op / -17.0% (better)
macOS AfterFuncZeroDelivery/LLGo 64809 ns/op -9296 ns/op / -12.5% (better)
macOS CreateStop/Go 115.100 ns/op -47 ns/op / -29.0% (better)
macOS CreateStop/LLGo 424.800 ns/op -54 ns/op / -11.3% (better)
macOS RearmStopped/Go 50.890 ns/op -4.79 ns/op / -8.6% (better)
macOS RearmStopped/LLGo 310.500 ns/op +18.2 ns/op / +6.2% (worse)
macOS ResetActive/Go 37.450 ns/op -15.37 ns/op / -29.1% (better)
macOS ResetActive/LLGo 146.500 ns/op -3 ns/op / -2.0% (better)
macOS ResetHeap1024/Go 37.560 ns/op -4.42 ns/op / -10.5% (better)
macOS ResetHeap1024/LLGo 74.470 ns/op -15.25 ns/op / -17.0% (better)
Windows MinGW AfterFuncZeroDelivery/Go 697.400 ns/op +9.5 ns/op / +1.4% (worse)
Windows MinGW AfterFuncZeroDelivery/LLGo 144310 ns/op +2097 ns/op / +1.5% (worse)
Windows MinGW CreateStop/Go 194.600 ns/op +5 ns/op / +2.6% (worse)
Windows MinGW CreateStop/LLGo 643.200 ns/op -12.8 ns/op / -2.0% (better)
Windows MinGW RearmStopped/Go 70.610 ns/op +0.46 ns/op / +0.7% (worse)
Windows MinGW RearmStopped/LLGo 304.400 ns/op -27.1 ns/op / -8.2% (better)
Windows MinGW ResetActive/Go 31.300 ns/op +0.19 ns/op / +0.6% (worse)
Windows MinGW ResetActive/LLGo 196.400 ns/op -13.2 ns/op / -6.3% (better)
Windows MinGW ResetHeap1024/Go 31.640 ns/op +0.2 ns/op / +0.6% (worse)
Windows MinGW ResetHeap1024/LLGo 136.500 ns/op +3.3 ns/op / +2.5% (worse)
Windows MinGW 386 AfterFuncZeroDelivery/Go 585.500 ns/op -46 ns/op / -7.3% (better)
Windows MinGW 386 AfterFuncZeroDelivery/LLGo 100218 ns/op -6934 ns/op / -6.5% (better)
Windows MinGW 386 CreateStop/Go 153.800 ns/op -13.2 ns/op / -7.9% (better)
Windows MinGW 386 CreateStop/LLGo 436.200 ns/op +24.3 ns/op / +5.9% (worse)
Windows MinGW 386 RearmStopped/Go 58.530 ns/op -5.3 ns/op / -8.3% (better)
Windows MinGW 386 RearmStopped/LLGo 249.100 ns/op -25.2 ns/op / -9.2% (better)
Windows MinGW 386 ResetActive/Go 27.970 ns/op -2.53 ns/op / -8.3% (better)
Windows MinGW 386 ResetActive/LLGo 541.900 ns/op -220.2 ns/op / -28.9% (better)
Windows MinGW 386 ResetHeap1024/Go 28.020 ns/op -2.45 ns/op / -8.0% (better)
Windows MinGW 386 ResetHeap1024/LLGo 114.900 ns/op -11.7 ns/op / -9.2% (better)
Windows MinGW ARM64 AfterFuncZeroDelivery/Go 664.500 ns/op -1.3 ns/op / -0.2% (better)
Windows MinGW ARM64 AfterFuncZeroDelivery/LLGo 144680 ns/op +8763 ns/op / +6.4% (worse)
Windows MinGW ARM64 CreateStop/Go 195.900 ns/op -1.9 ns/op / -1.0% (better)
Windows MinGW ARM64 CreateStop/LLGo 406.100 ns/op +5.6 ns/op / +1.4% (worse)
Windows MinGW ARM64 RearmStopped/Go 70.610 ns/op -0.05 ns/op / -0.1% (better)
Windows MinGW ARM64 RearmStopped/LLGo 259.900 ns/op +4.6 ns/op / +1.8% (worse)
Windows MinGW ARM64 ResetActive/Go 31.050 ns/op +0.02 ns/op / +0.1% (worse)
Windows MinGW ARM64 ResetActive/LLGo 130 ns/op -9.1 ns/op / -6.5% (better)
Windows MinGW ARM64 ResetHeap1024/Go 31.060 ns/op -0.06 ns/op / -0.2% (better)
Windows MinGW ARM64 ResetHeap1024/LLGo 124.400 ns/op +0.1 ns/op / +0.1% (worse)
Windows MSVC AfterFuncZeroDelivery/Go 708.300 ns/op +0.1 ns/op / +0.01412% (worse)
Windows MSVC AfterFuncZeroDelivery/LLGo 147874 ns/op +1577 ns/op / +1.1% (worse)
Windows MSVC CreateStop/Go 192.300 ns/op -7.1 ns/op / -3.6% (better)
Windows MSVC CreateStop/LLGo 854 ns/op -97.8 ns/op / -10.3% (better)
Windows MSVC RearmStopped/Go 71.640 ns/op +0.07 ns/op / +0.1% (worse)
Windows MSVC RearmStopped/LLGo 387.400 ns/op +36.7 ns/op / +10.5% (worse)
Windows MSVC ResetActive/Go 31.760 ns/op +0.03 ns/op / +0.1% (worse)
Windows MSVC ResetActive/LLGo 175.800 ns/op -18.2 ns/op / -9.4% (better)
Windows MSVC ResetHeap1024/Go 32.020 ns/op -0.01 ns/op / -0.03122% (better)
Windows MSVC ResetHeap1024/LLGo 132.200 ns/op +1.3 ns/op / +1.0% (worse)
Windows MSVC 386 AfterFuncZeroDelivery/Go 619.900 ns/op +21.3 ns/op / +3.6% (worse)
Windows MSVC 386 AfterFuncZeroDelivery/LLGo 104415 ns/op -649 ns/op / -0.6% (better)
Windows MSVC 386 CreateStop/Go 159.700 ns/op +4.6 ns/op / +3.0% (worse)
Windows MSVC 386 CreateStop/LLGo 398.300 ns/op +84 ns/op / +26.7% (worse)
Windows MSVC 386 RearmStopped/Go 60.790 ns/op +1.89 ns/op / +3.2% (worse)
Windows MSVC 386 RearmStopped/LLGo 223.300 ns/op -8.9 ns/op / -3.8% (better)
Windows MSVC 386 ResetActive/Go 29.230 ns/op +1.05 ns/op / +3.7% (worse)
Windows MSVC 386 ResetActive/LLGo 737.200 ns/op -26.4 ns/op / -3.5% (better)
Windows MSVC 386 ResetHeap1024/Go 29.490 ns/op +1.42 ns/op / +5.1% (worse)
Windows MSVC 386 ResetHeap1024/LLGo 115.100 ns/op +3.7 ns/op / +3.3% (worse)
Windows MSVC ARM64 AfterFuncZeroDelivery/Go 667.300 ns/op -10.8 ns/op / -1.6% (better)
Windows MSVC ARM64 AfterFuncZeroDelivery/LLGo 165773 ns/op +1125 ns/op / +0.7% (worse)
Windows MSVC ARM64 CreateStop/Go 206.400 ns/op +5.6 ns/op / +2.8% (worse)
Windows MSVC ARM64 CreateStop/LLGo 461.700 ns/op +32.3 ns/op / +7.5% (worse)
Windows MSVC ARM64 RearmStopped/Go 70.560 ns/op -0.06 ns/op / -0.1% (better)
Windows MSVC ARM64 RearmStopped/LLGo 273.200 ns/op -4.6 ns/op / -1.7% (better)
Windows MSVC ARM64 ResetActive/Go 31.070 ns/op +0.17 ns/op / +0.6% (worse)
Windows MSVC ARM64 ResetActive/LLGo 153.900 ns/op +8.1 ns/op / +5.6% (worse)
Windows MSVC ARM64 ResetHeap1024/Go 31.070 ns/op +0.17 ns/op / +0.6% (worse)
Windows MSVC ARM64 ResetHeap1024/LLGo 135.700 ns/op -1.6 ns/op / -1.2% (better)

Compared with 783ec4fd3d57 measured in the same runner job.

@xushiwei
xushiwei merged commit 5f1f138 into xgo-dev:main Oct 4, 2026
98 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