-
Notifications
You must be signed in to change notification settings - Fork 831
Run nightly benchmarks #1803
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Run nightly benchmarks #1803
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d8265a2
benchmark workflow
jaydeluca 83edd82
fix whats inclued
jaydeluca 0efa622
host info
jaydeluca a8dacf2
host info
jaydeluca aa12656
cleanup
jaydeluca bc60f49
linting
jaydeluca 4f72fa3
linting
jaydeluca 0779c50
add mise command for running the benchmarks
jaydeluca File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,116 @@ | ||
| --- | ||
| name: Nightly Benchmarks | ||
|
|
||
| on: | ||
| schedule: | ||
| # Run at 2 AM UTC every day | ||
| - cron: "0 2 * * *" | ||
| workflow_dispatch: | ||
| inputs: | ||
| jmh_args: | ||
| description: "Additional JMH arguments (e.g., '-f 1 -wi 1 -i 3' for quick run)" | ||
| required: false | ||
| default: "" | ||
|
|
||
| permissions: {} | ||
|
|
||
| concurrency: | ||
| group: "benchmarks" | ||
|
|
||
| defaults: | ||
| run: | ||
| shell: bash | ||
|
|
||
| jobs: | ||
| benchmark: | ||
| runs-on: ubuntu-24.04 | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| - name: Checkout main branch | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| persist-credentials: true | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Setup mise | ||
| uses: jdx/mise-action@6d1e696aa24c1aa1bcc1adea0212707c71ab78a8 # v3.6.1 | ||
| with: | ||
| version: v2026.1.4 | ||
| sha256: 79c798e39b83f0dd80108eaa88c6ca63689695ae975fd6786e7a353ef9f87002 | ||
|
|
||
| - name: Cache local Maven repository | ||
| uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2 | ||
| with: | ||
| path: ~/.m2/repository | ||
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-maven- | ||
|
|
||
| - name: Build benchmarks module | ||
| run: ./mvnw -pl benchmarks -am -DskipTests clean package | ||
|
|
||
| - name: Run JMH benchmarks | ||
| run: | | ||
| # 3 forks, 3 warmup, 5 measurement iterations (~60 min total) | ||
| DEFAULT_ARGS="-f 3 -wi 3 -i 5" | ||
| JMH_ARGS="${INPUT_JMH_ARGS:-$DEFAULT_ARGS}" | ||
|
|
||
| echo "Running benchmarks with args: $JMH_ARGS" | ||
|
|
||
| # shellcheck disable=SC2086 # Intentional word splitting for JMH args | ||
| java -jar ./benchmarks/target/benchmarks.jar \ | ||
| -rf json \ | ||
| -rff benchmark-results.json \ | ||
| $JMH_ARGS | ||
| env: | ||
| INPUT_JMH_ARGS: ${{ github.event.inputs.jmh_args }} | ||
|
|
||
| - name: Generate benchmark summary | ||
| run: | | ||
| python3 .mise/tasks/generate_benchmark_summary.py \ | ||
|
||
| --input benchmark-results.json \ | ||
| --output-dir benchmark-results \ | ||
| --commit-sha "${{ github.sha }}" | ||
| env: | ||
| GITHUB_REPOSITORY: ${{ github.repository }} | ||
|
|
||
| - name: Commit and push results to benchmarks branch | ||
| run: | | ||
| # Save results to a temp location | ||
| mkdir -p /tmp/benchmark-output | ||
| cp -r benchmark-results/* /tmp/benchmark-output/ | ||
|
|
||
| git config user.name "github-actions[bot]" | ||
| git config user.email "github-actions[bot]@users.noreply.github.com" | ||
|
|
||
| # Checkout or create benchmarks branch (use -- to disambiguate from benchmarks/ directory) | ||
| if git ls-remote --heads origin benchmarks | grep -q benchmarks; then | ||
| git fetch origin benchmarks | ||
| git switch benchmarks | ||
| # Preserve existing history | ||
| if [ -d history ]; then | ||
| cp -r history /tmp/benchmark-output/ | ||
| fi | ||
| else | ||
| git switch --orphan benchmarks | ||
| fi | ||
|
|
||
| # Clean working directory | ||
| git rm -rf . 2>/dev/null || true | ||
| find . -mindepth 1 -maxdepth 1 ! -name '.git' -exec rm -rf {} + | ||
|
|
||
| # Copy only the benchmark results | ||
| cp -r /tmp/benchmark-output/* . | ||
|
|
||
| git add README.md results.json history/ | ||
|
|
||
| DATE=$(date -u +"%Y-%m-%d") | ||
| COMMIT_SHORT=$(echo "${{ github.sha }}" | cut -c1-7) | ||
|
|
||
| git commit \ | ||
| -m "Benchmark results for ${DATE} (${COMMIT_SHORT})" \ | ||
| -m "From commit ${{ github.sha }}" \ | ||
| || echo "No changes to commit" | ||
|
|
||
| git push origin benchmarks --force-with-lease || git push origin benchmarks | ||
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see you added mise commands - maybe also make this one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done