Introduce perf-report.yml - #712
Conversation
There was a problem hiding this comment.
Rust Benchmark
Details
| Benchmark suite | Current: 2fcf380 | Previous: dc4d694 | Ratio |
|---|---|---|---|
rule-match-browserlike/brave-list |
1389497420 ns/iter (± 22782504) |
2099334199 ns/iter (± 17991214) |
0.66 |
rule-match-first-request/brave-list |
1120369 ns/iter (± 25473) |
1421104 ns/iter (± 10951) |
0.79 |
blocker_new/brave-list |
78686703 ns/iter (± 2306165) |
112417642 ns/iter (± 561176) |
0.70 |
blocker_new/brave-list-deserialize |
21810222 ns/iter (± 553436) |
32505677 ns/iter (± 1294449) |
0.67 |
memory-usage-final/brave-list-initial |
9561338 B/iter (± 0) |
9561338 B/iter (± 0) |
1 |
memory-usage-final/brave-list-1000-requests |
3183886 B/iter (± 0) |
3183886 B/iter (± 0) |
1 |
memory-usage-max/brave-list-initial/max |
32070026 B/iter (± 0) |
32070026 B/iter (± 0) |
1 |
memory-usage-alloc-count/brave-list-initial/alloc-count |
284089 allocs/iter (± 0) |
284089 allocs/iter (± 0) |
1 |
memory-usage-alloc-count/brave-list-1000-requests/alloc-count |
80628 allocs/iter (± 0) |
80628 allocs/iter (± 0) |
1 |
url_cosmetic_resources/brave-list |
131354 ns/iter (± 2653) |
184145 ns/iter (± 1771) |
0.71 |
cosmetic-class-id-match/brave-list |
2134858 ns/iter (± 557919) |
3240078 ns/iter (± 845876) |
0.66 |
This comment was automatically generated by workflow using github-action-benchmark.
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Rust Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.10.
| Benchmark suite | Current: 1a4845c | Previous: dc4d694 | Ratio |
|---|---|---|---|
rule-match-first-request/brave-list |
1589064 ns/iter (± 11987) |
1421104 ns/iter (± 10951) |
1.12 |
This comment was automatically generated by workflow using github-action-benchmark.
Performance report
Flamegraphs are attached as the |
| import html | ||
| import pathlib | ||
| import re | ||
| import subprocess |
There was a problem hiding this comment.
reported by reviewdog 🐶
[opengrep] Consider possible security implications associated with subprocess module.
Source: https://semgrep.dev/r/gitlab.bandit.B404
Cc @thypon
Please consider an alternative approach that avoids this security concern, or request a review from the sec-team on slack.
Performance report
Flamegraphs: download |
Performance report
Flamegraphs: https://github.com/brave/adblock-rust/actions/runs/30549895108/artifacts/8762588382 (open while logged into GitHub). |
Performance report
Flamegraphs: https://github.com/brave/adblock-rust/actions/runs/30575395224/artifacts/8772699195 (open while logged into GitHub). |
Performance report
Flamegraphs: https://github.com/brave/adblock-rust/actions/runs/30576952169/artifacts/8773326424. |
There was a problem hiding this comment.
Pull request overview
Adds an on-demand GitHub Actions workflow to generate a detailed, artifact-backed performance report for pull requests by benchmarking and profiling both the PR head and its merge base.
Changes:
- Introduces a new optional
perf-reportworkflow that benchmarks + profiles base vs head and posts a PR comment linking to the generated report artifact. - Adds scripts to run Criterion baselines, capture
perfprofiles, and build a self-contained HTML report embedding flamegraphs and critcmp output. - Normalizes quoting in the existing benchmark runner script for consistency with the new tooling.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/perf-report.yml | New labeled/manual workflow that installs perf tooling, runs base/head benchmarks + profiles, builds and uploads the HTML report, comments on the PR, and removes the label. |
| .github/scripts/run-perf-profile.sh | New script to perf record selected benchmarks and render (diff) flamegraphs via inferno + rustfilt. |
| .github/scripts/run-perf-benchmarks.sh | New script to save Criterion baselines for base/head so critcmp can diff them. |
| .github/scripts/run-benchmarks.sh | Small update to quote benchmark filters consistently. |
| .github/scripts/build-perf-report.py | New report builder that embeds SVG flamegraphs and a critcmp table into a single HTML artifact and emits PR-comment markdown. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The PR introduces a new optional CI build to generate a detailed perf report.
perf+ inferno to produce a flamegraph;rustfiltto propery demangle flamegraphs;perf-reportlabel and removes it after the run.An example report on a test pr with a worse tokenization strategy:
https://github.com/brave/adblock-rust/actions/runs/30578642537/artifacts/8773964960
the flamegraph diff:
