-
Notifications
You must be signed in to change notification settings - Fork 1.5k
ci: add performance benchmarks #4998
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
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
ef89eb0
ci: add performance benchmarks
agostbiro 4b6841d
Add snapshot for all scenarios
agostbiro a4eae0f
Don't try to run snapshot as scenario
agostbiro 50eb9b0
Fix check for trusted collaborators
agostbiro 5d863d3
Allow running in main
agostbiro 0146afd
Update results repository
agostbiro 42e7080
Spawn subprocess for each scenario
agostbiro 20212c8
Fix output being truncated
agostbiro fa75948
Flush stdout explicitly
agostbiro fc7126a
Add benchmark variance analysis
agostbiro 76b748c
Flash stdout for report
agostbiro b2c6907
Rename out to benchmark-variance
agostbiro 84110df
Rename openzeppelin
agostbiro eccb51c
Temporarily disable get block by number
agostbiro fcb29a8
Add rust benchmark variance
agostbiro ca32351
Revert "Temporarily disable get block by number"
agostbiro 206deb1
Add nodejs flags to reduce variance
agostbiro 65165fe
Add nodejs flags to reduce variance to subprocesses
agostbiro f1be692
Increase --max-old-space-size=28000
agostbiro acad1ee
Hold on to RPC results to avoid GC
agostbiro eb61f90
Increase alert threshold to 110%
agostbiro 03eb2b0
Temp
agostbiro 32f7769
Debug
agostbiro 46c0445
Debug
agostbiro 68f60dd
Debug
agostbiro 082edb9
Remove debug
agostbiro 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 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,85 @@ | ||
name: EDR Benchmark | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- ".github/workflows/edr-benchmark.yml" | ||
- "rust-toolchain" | ||
- "Cargo.lock" | ||
- "Cargo.toml" | ||
- "crates/**" | ||
pull_request: | ||
branches: | ||
- "**" | ||
paths: | ||
- ".github/workflows/edr-benchmark.yml" | ||
- "rust-toolchain" | ||
- "Cargo.lock" | ||
- "Cargo.toml" | ||
- "crates/**" | ||
workflow_dispatch: | ||
|
||
defaults: | ||
run: | ||
working-directory: crates/tools/js/benchmark | ||
|
||
concurrency: | ||
group: ${{github.workflow}}-${{github.ref}} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
js-benchmark: | ||
name: Run JS scenario runner benchmark | ||
environment: github-action-benchmark | ||
runs-on: self-hosted | ||
# Only run for trusted collaborators since third-parties could run malicious code on the self-hosted benchmark runner. | ||
if: github.ref == 'refs/heads/main' || (github.event.pull_request.author_association == 'OWNER' || github.event.pull_request.author_association == 'MEMBER' || github.event.pull_request.author_association == 'COLLABORATOR') | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
- name: Install Node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 20 | ||
cache: pnpm | ||
|
||
- name: Install Rust (stable) | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
override: true | ||
|
||
- name: Install package | ||
run: pnpm install --frozen-lockfile --prefer-offline | ||
|
||
- name: Run benchmark | ||
run: pnpm run -s benchmark | ||
|
||
- name: Validate regressions | ||
run: pnpm run -s verify | ||
|
||
- name: Generate report for github-action-benchmark | ||
run: pnpm run -s report | tee report.json | ||
|
||
- name: Store benchmark result | ||
uses: benchmark-action/github-action-benchmark@v1 | ||
with: | ||
tool: customSmallerIsBetter | ||
output-file-path: crates/tools/js/benchmark/report.json | ||
gh-repository: github.com/nomic-foundation-automation/edr-benchmark-results | ||
gh-pages-branch: main | ||
benchmark-data-dir-path: bench | ||
github-token: ${{ secrets.BENCHMARK_GITHUB_TOKEN }} | ||
# Only save the data for main branch pushes. For PRs we only compare | ||
auto-push: ${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }} | ||
alert-threshold: "110%" | ||
# Only fail on pull requests, don't break CI in main | ||
fail-on-alert: ${{ github.event_name == 'pull_request' }} | ||
# Enable Job Summary for PRs | ||
summary-always: true | ||
max-items-in-chart: 1000 |
This file contains 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 |
---|---|---|
|
@@ -114,3 +114,6 @@ Brewfile.lock.json | |
|
||
# Ipython Notebook | ||
.ipynb_checkpoints | ||
|
||
# Benchmark | ||
benchmark-output.json |
This file contains 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.
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.
Only running for changes to EDR since it's very slow and there is only one runner + we'll do this anyway once EDR is a separate repo