-
Notifications
You must be signed in to change notification settings - Fork 0
Add deterministic Callgrind benchmarking harness + periodic CI workflow for libgraphql-parser #104
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
Open
jeffmo
wants to merge
6
commits into
main
Choose a base branch
from
claude/lg-parser-benchmarking-harness-9tg04k
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c8c874a
Add deterministic Callgrind benchmark harness for libgraphql-parser
claude 8443bb6
Add wrapper script to run + report Callgrind benchmarks
claude 562dab0
Add periodic parser-benchmarks CI workflow
claude 77c9197
Document the deterministic Callgrind benchmark suite in README
claude 4fbda54
Address code review: report robustness + benchmark fairness fixes
claude 8cccc89
Fix CI: collapsible_match lint + restrict workflow token permissions
claude 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,80 @@ | ||
| run-name: "Parser benchmarks (${{ github.event_name == 'schedule' && 'scheduled' || format('@{0}', github.actor) }})" | ||
|
|
||
| # Deterministic benchmarks for libgraphql-parser, run under Valgrind's | ||
| # Callgrind (via iai-callgrind). Callgrind executes the benchmarks on | ||
| # a simulated CPU and counts exact instructions + simulated cache | ||
| # hits/misses, so results are reproducible even on noisy shared CI | ||
| # runners — unlike wall-clock benchmarks, which are meaningless there. | ||
| # | ||
| # Runs on demand (workflow_dispatch) and on a monthly schedule to | ||
| # check how libgraphql-parser compares against the latest releases of | ||
| # other GraphQL parsers on crates.io. The markdown report lands in | ||
| # the workflow run's summary page; raw iai-callgrind output is | ||
| # uploaded as an artifact. | ||
|
|
||
| name: "Parser benchmarks" | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| use_latest_competitor_parsers: | ||
| description: "Benchmark against the latest crates.io releases of graphql-parser and apollo-parser (instead of the versions pinned in Cargo.lock)" | ||
| type: "boolean" | ||
| default: true | ||
| schedule: | ||
| # 06:23 UTC on the 2nd of every month. Odd minute chosen to avoid | ||
| # the on-the-hour thundering herd on GitHub's shared runners. | ||
| - cron: "23 6 2 * *" | ||
|
|
||
| env: | ||
| CARGO_TERM_COLOR: "always" | ||
|
|
||
| # The job only reads the repo and uploads a workflow artifact; it | ||
| # never needs write access to repository contents, issues, or PRs. | ||
| permissions: | ||
| contents: "read" | ||
|
|
||
| jobs: | ||
| callgrind-benchmarks: | ||
| runs-on: "ubuntu-latest" | ||
| timeout-minutes: 90 | ||
| steps: | ||
| - uses: "actions/checkout@v4" | ||
|
|
||
| - name: "Install valgrind" | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install --yes valgrind | ||
| valgrind --version | ||
|
|
||
| - name: "Install iai-callgrind-runner (version-matched to Cargo.lock)" | ||
| run: | | ||
| version="$( | ||
| cargo metadata --format-version 1 \ | ||
| | jq -r '.packages[] | select(.name == "iai-callgrind") | .version' | ||
| )" | ||
| echo "Installing iai-callgrind-runner ${version}" | ||
| cargo install iai-callgrind-runner --version "${version}" --locked | ||
|
|
||
| - name: "Fetch Shopify Admin schema fixture" | ||
| run: "${GITHUB_WORKSPACE}/crates/libgraphql-parser/scripts/fetch-shopify-admin-graphql-schema-fixture.sh" | ||
|
|
||
| - name: "Update competitor parsers to latest crates.io releases" | ||
| if: "github.event_name == 'schedule' || inputs.use_latest_competitor_parsers" | ||
| run: "${GITHUB_WORKSPACE}/crates/libgraphql-parser/scripts/ci/parser-benchmarks.use-latest-competitor-parsers.sh" | ||
|
|
||
| - name: "Run Callgrind benchmarks" | ||
| run: "${GITHUB_WORKSPACE}/crates/libgraphql-parser/scripts/run-callgrind-benchmarks.sh" | ||
|
|
||
| - name: "Publish report to workflow summary" | ||
| run: "cat ${GITHUB_WORKSPACE}/target/iai/REPORT.md >> ${GITHUB_STEP_SUMMARY}" | ||
|
|
||
| - name: "Upload raw iai-callgrind results" | ||
| uses: "actions/upload-artifact@v4" | ||
| with: | ||
| if-no-files-found: "error" | ||
| name: "callgrind-benchmark-results" | ||
| path: | | ||
| target/iai/**/summary.json | ||
| target/iai/REPORT.md | ||
| retention-days: 90 | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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.
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.
Uh oh!
There was an error while loading. Please reload this page.