-
Notifications
You must be signed in to change notification settings - Fork 2.5k
feat: add benchmark framework for collection mount performance #7915
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
chirag-bruno
wants to merge
7
commits into
usebruno:main
Choose a base branch
from
chirag-bruno:feat/benchmark-collection-mount
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
7 commits
Select commit
Hold shift + click to select a range
8585960
feat: add benchmark framework for collection mount performance
cchirag dd4840e
feat: reuse collection across iterations, add update-baseline input, …
cchirag 0e3661c
feat: reduce max size to 3000, update baselines from CI data, auto-co…
cchirag 4325f21
fix: handle PR comment permission error on fork PRs
cchirag f80f21d
feat: per-OS baselines from CI run data, auto-commit on update-baseline
cchirag 791d528
feat: include suite metadata (name, unit, direction) in benchmark res…
cchirag 29668da
feat: extract timing helpers, capture raw float ms in mount benchmark
cchirag 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,38 @@ | ||
| name: 'Run Benchmark Tests' | ||
| description: 'Run Playwright benchmark tests and compare against baseline' | ||
| inputs: | ||
| os: | ||
| description: 'Operating system (ubuntu, macos, windows)' | ||
| default: 'ubuntu' | ||
| update-baseline: | ||
| description: 'Update baseline instead of comparing' | ||
| default: 'false' | ||
| runs: | ||
| using: 'composite' | ||
| steps: | ||
| - name: Run Benchmark Tests (Ubuntu) | ||
| if: inputs.os == 'ubuntu' | ||
| shell: bash | ||
| run: xvfb-run npm run test:benchmark | ||
|
|
||
| - name: Run Benchmark Tests | ||
| if: inputs.os != 'ubuntu' | ||
| shell: bash | ||
| run: npm run test:benchmark | ||
|
|
||
| - name: Update Baseline | ||
| if: inputs.update-baseline == 'true' | ||
| shell: bash | ||
| run: >- | ||
| node tests/benchmarks/utils/compare.js | ||
| --results tests/benchmarks/results/mounting.json | ||
| --baseline tests/benchmarks/mounting/baseline.${{ inputs.os }}.json | ||
| --update-baseline | ||
|
|
||
| - name: Compare Against Baseline | ||
| if: inputs.update-baseline != 'true' | ||
| shell: bash | ||
| run: >- | ||
| node tests/benchmarks/utils/compare.js | ||
| --results tests/benchmarks/results/mounting.json | ||
| --baseline tests/benchmarks/mounting/baseline.${{ inputs.os }}.json |
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,88 @@ | ||
| name: Benchmarks | ||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| update-baseline: | ||
| description: 'Update baseline with current results instead of comparing' | ||
| type: boolean | ||
| default: false | ||
| pull_request: | ||
| branches: [main, 'release/v*'] | ||
|
|
||
| jobs: | ||
| benchmark: | ||
| name: Performance Benchmarks (${{ matrix.os }}) | ||
| timeout-minutes: 60 | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [ubuntu-24.04, macos-latest, windows-latest] | ||
| include: | ||
| - os: ubuntu-24.04 | ||
| os-name: ubuntu | ||
| - os: macos-latest | ||
| os-name: macos | ||
| - os: windows-latest | ||
| os-name: windows | ||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - name: Install System Dependencies (Ubuntu) | ||
| if: matrix.os-name == 'ubuntu' | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get --no-install-recommends install -y \ | ||
| libglib2.0-0 libnss3 libdbus-1-3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libgtk-3-0 libasound2t64 \ | ||
| xvfb | ||
|
|
||
| - name: Setup Node Dependencies | ||
| uses: ./.github/actions/common/setup-node-deps | ||
|
|
||
| - name: Configure Chrome Sandbox | ||
| if: matrix.os-name == 'ubuntu' | ||
| run: | | ||
| sudo chown root node_modules/electron/dist/chrome-sandbox | ||
| sudo chmod 4755 node_modules/electron/dist/chrome-sandbox | ||
|
|
||
| - name: Run Benchmark Tests | ||
| uses: ./.github/actions/tests/run-benchmark-tests | ||
| with: | ||
| os: ${{ matrix.os-name }} | ||
| update-baseline: ${{ github.event.inputs.update-baseline || 'false' }} | ||
|
|
||
| - name: Upload Benchmark Results | ||
| uses: actions/upload-artifact@v6 | ||
| if: ${{ !cancelled() }} | ||
| with: | ||
| name: benchmark-results-${{ matrix.os-name }} | ||
| path: | | ||
| tests/benchmarks/results/ | ||
| benchmark-report/ | ||
| retention-days: 30 | ||
|
|
||
| - name: Commit Updated Baseline | ||
| if: github.event.inputs.update-baseline == 'true' | ||
| run: | | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "github-actions[bot]@users.noreply.github.com" | ||
| git add tests/benchmarks/mounting/baseline.${{ matrix.os-name }}.json | ||
| git diff --staged --quiet || git commit -m "chore: update ${{ matrix.os-name }} benchmark baseline" && git push | ||
|
|
||
| - name: Comment Benchmark Results on PR | ||
| if: github.event_name == 'pull_request' && !cancelled() | ||
| continue-on-error: true | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| script: | | ||
| const run = require('./tests/benchmarks/utils/pr-comment.js'); | ||
| await run({ | ||
| github, | ||
| context, | ||
| resultsPath: 'tests/benchmarks/results/mounting.json', | ||
| baselinePath: 'tests/benchmarks/mounting/baseline.${{ matrix.os-name }}.json', | ||
| title: 'Benchmark Results — Collection Mount (${{ matrix.os-name }})' | ||
| }); | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| import { defineConfig } from '@playwright/test'; | ||
|
|
||
| export default defineConfig({ | ||
| fullyParallel: false, | ||
| forbidOnly: !!process.env.CI, | ||
| retries: 0, | ||
| workers: 1, | ||
| reporter: [ | ||
| ['list'], | ||
| ['json', { outputFile: 'benchmark-report/results.json' }] | ||
| ], | ||
|
|
||
| use: { | ||
| trace: 'off' | ||
| }, | ||
|
|
||
| projects: [ | ||
| { | ||
| name: 'benchmarks', | ||
| testDir: './tests/benchmarks', | ||
| testMatch: '**/*.bench.ts' | ||
| } | ||
| ], | ||
|
|
||
| webServer: [ | ||
| { | ||
| command: 'npm run dev:web', | ||
| url: 'http://localhost:3000', | ||
| reuseExistingServer: !process.env.CI, | ||
| timeout: 10 * 60 * 1000 | ||
| } | ||
| ], | ||
|
|
||
| timeout: 10 * 60 * 1000, | ||
| expect: { | ||
| timeout: 120_000 | ||
| } | ||
| }); |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| { | ||
| "thresholdPercent": 20, | ||
| "entries": { | ||
| "bru-50": { | ||
| "mean": 2200, | ||
| "p50": 1000 | ||
| }, | ||
| "bru-200": { | ||
| "mean": 1300, | ||
| "p50": 1100 | ||
| }, | ||
| "bru-500": { | ||
| "mean": 3600, | ||
| "p50": 3500 | ||
| }, | ||
| "bru-1000": { | ||
| "mean": 9100, | ||
| "p50": 9000 | ||
| }, | ||
| "bru-3000": { | ||
| "mean": 185000, | ||
| "p50": 183000 | ||
| }, | ||
| "yml-50": { | ||
| "mean": 700, | ||
| "p50": 650 | ||
| }, | ||
| "yml-200": { | ||
| "mean": 1400, | ||
| "p50": 1250 | ||
| }, | ||
| "yml-500": { | ||
| "mean": 3900, | ||
| "p50": 3700 | ||
| }, | ||
| "yml-1000": { | ||
| "mean": 11700, | ||
| "p50": 11900 | ||
| }, | ||
| "yml-3000": { | ||
| "mean": 85000, | ||
| "p50": 80000 | ||
| } | ||
| } | ||
| } |
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,45 @@ | ||
| { | ||
| "thresholdPercent": 20, | ||
| "entries": { | ||
| "bru-50": { | ||
| "mean": 1500, | ||
| "p50": 700 | ||
| }, | ||
| "bru-200": { | ||
| "mean": 1200, | ||
| "p50": 1150 | ||
| }, | ||
| "bru-500": { | ||
| "mean": 2900, | ||
| "p50": 2900 | ||
| }, | ||
| "bru-1000": { | ||
| "mean": 8000, | ||
| "p50": 8000 | ||
| }, | ||
| "bru-3000": { | ||
| "mean": 175000, | ||
| "p50": 170000 | ||
| }, | ||
| "yml-50": { | ||
| "mean": 600, | ||
| "p50": 560 | ||
| }, | ||
| "yml-200": { | ||
| "mean": 1200, | ||
| "p50": 1200 | ||
| }, | ||
| "yml-500": { | ||
| "mean": 3500, | ||
| "p50": 3400 | ||
| }, | ||
| "yml-1000": { | ||
| "mean": 10700, | ||
| "p50": 10650 | ||
| }, | ||
| "yml-3000": { | ||
| "mean": 85000, | ||
| "p50": 80000 | ||
| } | ||
| } | ||
| } |
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,45 @@ | ||
| { | ||
| "thresholdPercent": 20, | ||
| "entries": { | ||
| "bru-50": { | ||
| "mean": 2700, | ||
| "p50": 800 | ||
| }, | ||
| "bru-200": { | ||
| "mean": 1500, | ||
| "p50": 1400 | ||
| }, | ||
| "bru-500": { | ||
| "mean": 3500, | ||
| "p50": 3500 | ||
| }, | ||
| "bru-1000": { | ||
| "mean": 9500, | ||
| "p50": 9400 | ||
| }, | ||
| "bru-3000": { | ||
| "mean": 195000, | ||
| "p50": 190000 | ||
| }, | ||
| "yml-50": { | ||
| "mean": 600, | ||
| "p50": 570 | ||
| }, | ||
| "yml-200": { | ||
| "mean": 1350, | ||
| "p50": 1300 | ||
| }, | ||
| "yml-500": { | ||
| "mean": 3800, | ||
| "p50": 3700 | ||
| }, | ||
| "yml-1000": { | ||
| "mean": 11000, | ||
| "p50": 11000 | ||
| }, | ||
| "yml-3000": { | ||
| "mean": 90000, | ||
| "p50": 88000 | ||
| } | ||
|
sid-bruno marked this conversation as resolved.
|
||
| } | ||
| } | ||
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.