Skip to content

Commit 78ca7b8

Browse files
committed
fix 2 bechmark ci parllel matrix workflows
1 parent bcf2228 commit 78ca7b8

1 file changed

Lines changed: 59 additions & 19 deletions

File tree

‎.github/workflows/benchmark.yml‎

Lines changed: 59 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,21 @@ permissions:
88

99
jobs:
1010
benchmark:
11-
name: Run Enterprise Benchmarks
11+
name: Bench · ${{ matrix.name }}
1212
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
include:
17+
- name: spsc-queue
18+
filter: "SpscEventBenchmark"
19+
extra_params: ""
20+
- name: scaling-low
21+
filter: "S1_S5_ThroughputLatencyBenchmark"
22+
extra_params: "-p payloadSize=64 -p concurrency=1:1,4:1"
23+
- name: scaling-high
24+
filter: "S1_S5_ThroughputLatencyBenchmark"
25+
extra_params: "-p payloadSize=64 -p concurrency=8:1,16:4,32:8"
1326

1427
steps:
1528
- name: Checkout
@@ -22,47 +35,74 @@ jobs:
2235
distribution: 'temurin'
2336
cache: maven
2437

25-
- name: Enable perf_events for async-profiler
38+
- name: Build zThread
39+
run: ./mvnw clean install -DskipTests --batch-mode --no-transfer-progress
40+
41+
- name: Run Benchmarks
42+
timeout-minutes: 10
2643
run: |
27-
sudo sysctl -w kernel.perf_event_paranoid=1
28-
sudo sysctl -w kernel.kptr_restrict=0
44+
timeout 300 ./mvnw exec:exec -pl zthread-benchmark -Dexec.executable="java" \
45+
-Dexec.args="-classpath %classpath \
46+
--enable-native-access=ALL-UNNAMED -XX:+UseZGC \
47+
org.openjdk.jmh.Main ${{ matrix.filter }} ${{ matrix.extra_params }} \
48+
-rf json -rff target/benchmark-${{ matrix.name }}.json -prof gc \
49+
-f 0 -wi 1 -i 2 -r 1s" --batch-mode || true
50+
if [ ! -s zthread-benchmark/target/benchmark-${{ matrix.name }}.json ]; then
51+
echo "ERROR: benchmark-${{ matrix.name }}.json was not generated"
52+
exit 1
53+
fi
54+
55+
- name: Upload Results
56+
uses: actions/upload-artifact@v4
57+
with:
58+
name: benchmark-${{ matrix.name }}
59+
path: zthread-benchmark/target/benchmark-${{ matrix.name }}.json
60+
61+
report:
62+
name: Generate Reports
63+
runs-on: ubuntu-latest
64+
needs: benchmark
65+
66+
steps:
67+
- name: Checkout
68+
uses: actions/checkout@v4
2969

3070
- name: Set up Python
3171
uses: actions/setup-python@v5
3272
with:
3373
python-version: '3.12'
3474

3575
- name: Install Charting Dependencies
36-
run: |
37-
python -m pip install --upgrade pip
38-
pip install matplotlib pandas seaborn
76+
run: pip install matplotlib pandas seaborn
3977

40-
- name: Build zThread
41-
run: ./mvnw clean install -DskipTests --batch-mode --no-transfer-progress
42-
43-
- name: Run JMH Benchmarks
44-
run: ./mvnw exec:exec -pl zthread-benchmark -Dexec.executable="java" -Dexec.args="-classpath %classpath org.openjdk.jmh.Main (SpscEventBenchmark|S1_S5_ThroughputLatencyBenchmark) -p payloadSize=64 -rf json -rff target/benchmark.json -prof gc -f 0 -wi 1 -i 2 -r 1s" --batch-mode
78+
- name: Download All Results
79+
uses: actions/download-artifact@v4
80+
with:
81+
path: benchmark-results
82+
pattern: benchmark-*
83+
merge-multiple: true
4584

46-
- name: Generate Charts and Report
85+
- name: Merge & Generate Charts
4786
run: |
48-
# Generate benchmark report inside zthread-benchmark
87+
mkdir -p zthread-benchmark/target
88+
jq -s 'add' benchmark-results/*.json > zthread-benchmark/target/benchmark.json
89+
echo "Merged $(jq length zthread-benchmark/target/benchmark.json) benchmark entries"
90+
4991
cd zthread-benchmark
5092
python scripts/generate_charts.py target/benchmark.json
51-
52-
# Generate main README.md graph and update table
5393
cd ..
5494
python scripts/generate-graph.py zthread-benchmark/target/benchmark.json
5595
56-
- name: Commit Updated Benchmark Data
96+
- name: Commit Updated Data
5797
uses: stefanzweifel/git-auto-commit-action@v5
5898
with:
5999
commit_message: "docs(benchmark): auto-update performance charts and README"
60100
file_pattern: "README.md assets/benchmark_graph.svg zthread-benchmark/charts/* zthread-benchmark/benchmark.md"
61101

62-
- name: Upload Benchmark Results
102+
- name: Upload Final Report
63103
uses: actions/upload-artifact@v4
64104
with:
65-
name: benchmark-results
105+
name: benchmark-report
66106
path: |
67107
zthread-benchmark/target/benchmark.json
68108
zthread-benchmark/charts/

0 commit comments

Comments
 (0)