-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (72 loc) · 2.85 KB
/
Copy pathbenchmark.yml
File metadata and controls
80 lines (72 loc) · 2.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Benchmark
# Manual, exploratory, on every runner OS the repo supports. Not part of
# ci.yml: JMH runs are too slow to gate every push/PR.
#
# Reports zstd-java (byte[] and MemorySegment) against zstd-jni and
# aircompressor on identical input, plus reused-vs-fresh-per-call native
# context overhead - the "is this library actually fast" evidence.
#
# Results are consumable two ways: the table is both printed to the job log
# (no sign-in needed, unlike the Step Summary UI) and uploaded as a
# per-classifier artifact - `gh run download <run-id>` gets the raw JMH JSON
# plus the rendered table for offline diffing or archiving across runs.
on:
workflow_dispatch:
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 (with zstd submodule)
uses: actions/checkout@v7
with:
submodules: recursive
- 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
# Anchored on the package-separator dot so `CompressBenchmark` doesn't
# also match `MultiThreadCompressBenchmark` (JMH's filter is a
# substring/regex search) - that class has no zstdJni/aircompressor
# peers, so it only pollutes the contestants table with empty cells.
# GoldenCorpusBenchmark stays excluded - keeps this to the quick
# synthetic-payload suite, not the slower real-corpus one.
- name: Build + run benchmark
shell: bash
run: |
./mvnw -B -ntp -q -pl benchmark -am package -DskipTests
java -jar benchmark/target/benchmarks.jar '\.CompressBenchmark\.' '\.DecompressBenchmark\.' \
-f 1 -wi 2 -i 5 -p size=65536 -rf json -rff results.json
- name: Report contestants (zstd-java vs zstd-jni vs aircompressor)
if: always()
shell: bash
run: |
{
echo "### ${{ matrix.classifier }}"
echo
python3 .github/scripts/format-contestants.py results.json
} | tee contestants.md | tee -a "$GITHUB_STEP_SUMMARY"
- name: Upload benchmark results
if: always()
uses: actions/upload-artifact@v7
with:
name: benchmark-results-${{ matrix.classifier }}
path: |
results.json
contestants.md
if-no-files-found: ignore
retention-days: 30