Repository navigation
zThread Continuous Performance Benchmark Suite #12
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 Suite | |
| on: | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| benchmark: | |
| name: Bench · ${{ matrix.name }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: spsc-queue | |
| filter: "SpscEventBenchmark" | |
| extra_params: "" | |
| - name: scaling-low | |
| filter: "S1_S5_ThroughputLatencyBenchmark" | |
| extra_params: "-p payloadSize=64 -p concurrency=1:1,4:1" | |
| - name: scaling-high | |
| filter: "S1_S5_ThroughputLatencyBenchmark" | |
| extra_params: "-p payloadSize=64 -p concurrency=8:1,16:4,32:8" | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 25 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '25' | |
| distribution: 'temurin' | |
| cache: maven | |
| - name: Build zThread | |
| run: ./mvnw clean install -DskipTests --batch-mode --no-transfer-progress | |
| - name: Run Benchmarks | |
| timeout-minutes: 10 | |
| run: | | |
| timeout 300 ./mvnw exec:exec -pl zthread-benchmark -Dexec.executable="java" \ | |
| -Dexec.args="-classpath %classpath \ | |
| --enable-native-access=ALL-UNNAMED -XX:+UseZGC \ | |
| org.openjdk.jmh.Main ${{ matrix.filter }} ${{ matrix.extra_params }} \ | |
| -rf json -rff target/benchmark-${{ matrix.name }}.json -prof gc \ | |
| -f 0 -wi 1 -i 2 -r 1s" --batch-mode || true | |
| if [ ! -s zthread-benchmark/target/benchmark-${{ matrix.name }}.json ]; then | |
| echo "ERROR: benchmark-${{ matrix.name }}.json was not generated" | |
| exit 1 | |
| fi | |
| - name: Upload Results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: benchmark-${{ matrix.name }} | |
| path: zthread-benchmark/target/benchmark-${{ matrix.name }}.json | |
| report: | |
| name: Generate Reports | |
| runs-on: ubuntu-latest | |
| needs: benchmark | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install Charting Dependencies | |
| run: pip install matplotlib pandas seaborn tabulate | |
| - name: Download All Results | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: benchmark-results | |
| pattern: benchmark-* | |
| merge-multiple: true | |
| - name: Merge & Generate Charts | |
| run: | | |
| mkdir -p zthread-benchmark/target | |
| jq -s 'add' benchmark-results/*.json > zthread-benchmark/target/benchmark.json | |
| echo "Merged $(jq length zthread-benchmark/target/benchmark.json) benchmark entries" | |
| cd zthread-benchmark | |
| python scripts/generate_charts.py target/benchmark.json | |
| cd .. | |
| python scripts/generate-graph.py zthread-benchmark/target/benchmark.json | |
| - name: Commit Updated Data | |
| uses: stefanzweifel/git-auto-commit-action@v5 | |
| with: | |
| commit_message: "docs(benchmark): auto-update performance charts and README" | |
| file_pattern: "README.md assets/benchmark_graph.svg zthread-benchmark/charts/* zthread-benchmark/benchmark.md" | |
| - name: Upload Final Report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: benchmark-report | |
| path: | | |
| zthread-benchmark/target/benchmark.json | |
| zthread-benchmark/charts/ | |
| zthread-benchmark/benchmark.md | |
| assets/benchmark_graph.svg | |
| retention-days: 14 |