Skip to content

ci: add manual workflow to benchmark LTO's impact per platform#74

Merged
dfa1 merged 1 commit into
mainfrom
benchmark-lto-workflow
Jul 17, 2026
Merged

ci: add manual workflow to benchmark LTO's impact per platform#74
dfa1 merged 1 commit into
mainfrom
benchmark-lto-workflow

Conversation

@dfa1

@dfa1 dfa1 commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Summary

Follow-up to #72 (LTO experiment, Linux-only): a manual workflow_dispatch workflow that turns the "LTO is a no-op on macOS/Windows, real on Linux" claim into CI evidence per platform rather than a manual assertion.

For each of linux-x86_64, linux-aarch64, osx-aarch64, windows-x86_64:

  • Checks out main and an LTO variant branch (defaults to experiment/lto-linux, overridable via the lto_ref input) side by side into separate directories.
  • Builds and runs CompressBenchmark/DecompressBenchmark (quick smoke settings — 1 fork, 2 warmup, 5 measurement, size=65536) against each.
  • Writes a comparison table to the job summary via the new .github/scripts/compare-benchmarks.py.

Not wired into ci.yml — JMH runs are too slow for every push/PR, and this is throughput exploration, not a correctness gate.

Expected outcome once run: linux-x86_64/linux-aarch64 show a real delta (matching the local +6.9%/+12-14% ballpark we measured for the -mcpu flag, though this workflow isolates LTO specifically), osx-aarch64/windows-x86_64 show ~0% (since LTO_FLAG stays empty for those classifiers in scripts/build-zstd.sh).

Test plan

  • actionlint clean on the new workflow
  • compare-benchmarks.py tested against real JMH JSON output (not just syntax-checked) — found and fixed a real bug: scoreError comes through as the JSON string "NaN" (not a number) when JMH can't compute a confidence interval (e.g. too few iterations); fixed with an explicit float() cast
  • Run the workflow itself (workflow_dispatch) once merged — this PR doesn't include an actual run's output since it's manually triggered

🤖 Generated with Claude Code

Adds .github/workflows/benchmark-lto.yml (workflow_dispatch only - JMH
runs are too slow for every push/PR, and this is throughput
exploration, not a correctness gate).

For each of linux-x86_64, linux-aarch64, osx-aarch64, windows-x86_64:
checks out main and an LTO variant branch (default
experiment/lto-linux, overridable via the lto_ref input) side by side,
builds+runs the CompressBenchmark/DecompressBenchmark suite (quick
smoke settings: 1 fork, 2 warmup, 5 measurement, size=65536) against
each, and writes a comparison table to the job summary via the new
.github/scripts/compare-benchmarks.py.

This turns the "-flto is Linux-only, no-op elsewhere" claim from #70/
#72 into CI evidence per platform instead of a manual assertion -
linux-x86_64/linux-aarch64 should show a real delta, osx-aarch64/
windows-x86_64 should show ~0% (LTO_FLAG stays empty for those
classifiers in scripts/build-zstd.sh).

Verified locally:
  - actionlint clean
  - compare-benchmarks.py tested against real JMH JSON output; found
    and fixed a real bug along the way - scoreError comes through as
    the JSON string "NaN" (not a number) when JMH can't compute a
    confidence interval, e.g. with few iterations
@dfa1
dfa1 merged commit 0228314 into main Jul 17, 2026
1 check passed
@dfa1
dfa1 deleted the benchmark-lto-workflow branch July 17, 2026 16:45
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.

1 participant