Benchmark LTO impact #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Benchmark LTO impact | |
| # Manual, exploratory: compares JMH throughput between main and an LTO | |
| # variant branch (see scripts/build-zstd.sh - currently -flto is Linux-only, | |
| # zig's Mach-O backend doesn't support it) on every runner OS the repo | |
| # supports, so the real-vs-no-op split shows up as CI evidence per platform | |
| # instead of a manual claim. Not part of ci.yml: this is throughput | |
| # exploration, not a correctness gate, and JMH runs are too slow to run on | |
| # every push/PR. | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| lto_ref: | |
| description: Branch/ref with the LTO change to compare against main. | |
| required: false | |
| default: experiment/lto-linux | |
| jobs: | |
| benchmark: | |
| name: ${{ matrix.classifier }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - { os: ubuntu-latest, classifier: linux-x86_64 } | |
| - { os: ubuntu-24.04-arm, classifier: linux-aarch64 } | |
| - { os: macos-14, classifier: osx-aarch64 } | |
| - { os: windows-latest, classifier: windows-x86_64 } | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout baseline (main, with zstd submodule) | |
| uses: actions/checkout@v7 | |
| with: | |
| submodules: recursive | |
| path: baseline | |
| - name: Checkout LTO variant (${{ inputs.lto_ref }}, with zstd submodule) | |
| uses: actions/checkout@v7 | |
| with: | |
| submodules: recursive | |
| ref: ${{ inputs.lto_ref }} | |
| path: lto | |
| - name: Set up JDK 25 | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: temurin | |
| java-version: '25' | |
| cache: maven | |
| - name: Set up Zig | |
| uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2 | |
| with: | |
| version: 0.16.0 | |
| # `ompressBenchmark` matches both CompressBenchmark and | |
| # DecompressBenchmark method FQNs (JMH's filter is a substring/regex | |
| # search), but not GoldenCorpusBenchmark - keeps this to the quick | |
| # synthetic-payload suite, not the slower real-corpus one. | |
| - name: Build + run baseline benchmark | |
| shell: bash | |
| working-directory: baseline | |
| run: | | |
| ./mvnw -B -ntp -q -pl benchmark -am package -DskipTests | |
| java -jar benchmark/target/benchmarks.jar ompressBenchmark \ | |
| -f 1 -wi 2 -i 5 -p size=65536 -rf json -rff ../baseline-results.json | |
| - name: Build + run LTO-variant benchmark | |
| shell: bash | |
| working-directory: lto | |
| run: | | |
| ./mvnw -B -ntp -q -pl benchmark -am package -DskipTests | |
| java -jar benchmark/target/benchmarks.jar ompressBenchmark \ | |
| -f 1 -wi 2 -i 5 -p size=65536 -rf json -rff ../lto-results.json | |
| - name: Summarize | |
| shell: bash | |
| run: | | |
| # tee, not just >>, so the table also lands in the plain job log - | |
| # $GITHUB_STEP_SUMMARY is a web-UI-only feature (client-side render, | |
| # not exposed via the REST API), so a redirect-only version isn't | |
| # fetchable by tooling, only by a human clicking into the run. | |
| { | |
| echo "### ${{ matrix.classifier }}" | |
| echo | |
| python3 baseline/.github/scripts/compare-benchmarks.py \ | |
| baseline-results.json lto-results.json | |
| echo | |
| } | tee -a "$GITHUB_STEP_SUMMARY" |