Skip to content
Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
47fd087
feat(benches): add Criterion benchmarks for historic scanning mode
yug49 Dec 13, 2025
329e2a4
Add latest events scanning benchmark
yug49 Dec 13, 2025
988adea
Update Cargo.lock
yug49 Dec 13, 2025
8ff77f3
feat(benches): optimize benchmarks and simplify BenchConfig API
yug49 Dec 17, 2025
fa67e5b
chore: update Cargo.lock with latest dependency versions
yug49 Dec 17, 2025
7ec2a3d
Merge branch 'OpenZeppelin:main' into feat/benchmarks
yug49 Dec 21, 2025
28c052c
feat: add Bencher CI integration for performance tracking
yug49 Dec 21, 2025
f7a3d81
fix: remove invalid --noplot flag from benchmark command
yug49 Dec 21, 2025
70c6b17
perf: run benchmarks in parallel jobs to avoid disk space issues
yug49 Dec 21, 2025
b8146e8
fix: add disk cleanup step to free space before benchmarks
yug49 Dec 21, 2025
a53baef
perf: reduce latest events benchmark from 100K to 50K events
yug49 Dec 21, 2025
e541a36
fix: correct Bencher integration for baseline tracking
yug49 Dec 21, 2025
651bf30
fix: use dynamic branch name in Bencher upload
yug49 Dec 21, 2025
44e4ead
fix: remove --ci-only flag from PR tracking workflow
yug49 Dec 21, 2025
d5d7e9e
Update .github/workflows/benchmarks.yml
yug49 Dec 22, 2025
4825627
Update .github/workflows/benchmarks.yml
yug49 Dec 22, 2025
6a1e923
Update .github/workflows/benchmarks.yml
yug49 Dec 22, 2025
6f036a4
Merge branch 'OpenZeppelin:main' into feat/benchmarks
yug49 Dec 22, 2025
23c741c
refactor: update benchmark config and remove PR workflows
yug49 Dec 22, 2025
dc8f23d
Update .github/workflows/benchmarks.yml
yug49 Dec 25, 2025
798f9c5
Merge branch 'OpenZeppelin:main' into feat/benchmarks
yug49 Dec 25, 2025
ec4ed63
Remove log count tracking and assertion from historic scanning benchmark
yug49 Dec 25, 2025
78ed3bd
Rename BenchCounter to Counter
yug49 Dec 25, 2025
97cc1d9
bench: add 5s warm-up time to benchmark groups
yug49 Dec 25, 2025
4b71d12
feat: use singleton tokio runtime in benchmarks
yug49 Dec 25, 2025
ae58054
refactor(benches): replace panics with proper error handling
yug49 Dec 26, 2025
29acfb8
Update .github/workflows/benchmarks.yml
yug49 Dec 26, 2025
089d5af
fix: make benchmark jobs consistent with dependency versions
yug49 Dec 26, 2025
bb81e8d
feat: add benchmarking system using anvil dump files
yug49 Dec 29, 2025
c84172d
fix: increase benchmark measurement time to 200s
yug49 Dec 29, 2025
6b5141c
Update benches/benches/historic_scanning.rs
yug49 Dec 29, 2025
202ee64
fix: restore .clone() for provider in historic benchmark
yug49 Dec 29, 2025
6e74b55
Update .github/workflows/benchmarks.yml
yug49 Jan 20, 2026
8a2dc23
Update .github/workflows/benchmarks.yml
yug49 Jan 20, 2026
0dbf27f
Update benches/dumps/state_100000.metadata.json
yug49 Jan 20, 2026
16642f6
fix: apply --err flag only on manual workflow dispatch
yug49 Jan 20, 2026
3b34076
refactor: remove unnecessary sleep before Anvil shutdown
yug49 Jan 20, 2026
afd1c48
chore: resolve merge conflicts
yug49 Jan 20, 2026
dac85ae
Merge branch 'main' into feat/benchmarks
yug49 Jan 20, 2026
18cfe68
fix: update benchmarks to use robust-provider as direct dependency
yug49 Jan 20, 2026
1181f46
fix: remove --err flag from benchmark workflow
yug49 Jan 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
136 changes: 136 additions & 0 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
name: Benchmarks

# Runs benchmarks to track performance and detect regressions.
# - On push to main: automatically updates baseline in Bencher
# - On manual dispatch: run specific benchmarks on-demand

on:
push:
branches: [main]
paths:
# Only run benchmarks if relevant code changes
- "src/**"
- "benches/**"
- "Cargo.toml"
- "Cargo.lock"
workflow_dispatch:
inputs:
benchmark:
description: "Benchmark to run"
required: true
default: "all"
type: choice
options:
- all
- historic_scanning
- latest_events_scanning

permissions:
contents: read
checks: write

env:
CARGO_TERM_COLOR: always

jobs:
# Run historic benchmarks
benchmark_historic:
name: Run Historic Benchmarks
runs-on: ubuntu-latest
# Run on push to main, or when manually selecting 'all' or 'historic_scanning'
if: ${{ github.event_name == 'push' || inputs.benchmark == 'all' || inputs.benchmark == 'historic_scanning' }}

steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
with:
egress-policy: audit

- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2

- name: Install Foundry (Anvil)
uses: foundry-rs/foundry-toolchain@8b0419c685ef46cb79ec93fbdc131174afceb730 # v1.6.0

- name: Install Bencher CLI
uses: bencherdev/bencher@2f1532643adc0e69e52acaec936d227ff14da24f # v0.5.9

- name: Decompress benchmark state dumps
run: |
echo "Decompressing Anvil state dumps..."
gunzip -k benches/dumps/*.json.gz
ls -lh benches/dumps/

- name: Run historic benchmarks and track with Bencher
env:
BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }}
BENCHER_PROJECT: ${{ vars.BENCHER_PROJECT }}
run: |
bencher run \
--project "$BENCHER_PROJECT" \
--token "$BENCHER_API_TOKEN" \
--branch main \
--testbed ubuntu-latest \
--threshold-measure latency \
--threshold-test t_test \
--threshold-max-sample-size 64 \
--threshold-upper-boundary 0.99 \
--thresholds-reset \
${{ github.event_name == 'workflow_dispatch' && '--err' || '' }} \
--adapter rust_criterion \
--github-actions "${{ secrets.GITHUB_TOKEN }}" \
"cargo bench --manifest-path benches/Cargo.toml --bench historic_scanning"

# Run latest events benchmarks
benchmark_latest:
name: Run Latest Events Benchmarks
runs-on: ubuntu-latest
# Run on push to main, or when manually selecting 'all' or 'latest_events_scanning'
if: ${{ github.event_name == 'push' || inputs.benchmark == 'all' || inputs.benchmark == 'latest_events_scanning' }}

steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
with:
egress-policy: audit

- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2

- name: Install Foundry (Anvil)
uses: foundry-rs/foundry-toolchain@8b0419c685ef46cb79ec93fbdc131174afceb730 # v1.6.0

- name: Install Bencher CLI
uses: bencherdev/bencher@2f1532643adc0e69e52acaec936d227ff14da24f # v0.5.9

- name: Decompress benchmark state dumps
run: |
echo "Decompressing Anvil state dumps..."
gunzip -k benches/dumps/*.json.gz
ls -lh benches/dumps/

- name: Run latest events benchmarks and track with Bencher
env:
BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }}
BENCHER_PROJECT: ${{ vars.BENCHER_PROJECT }}
run: |
bencher run \
--project "$BENCHER_PROJECT" \
--token "$BENCHER_API_TOKEN" \
--branch main \
--testbed ubuntu-latest \
--threshold-measure latency \
--threshold-test t_test \
--threshold-max-sample-size 64 \
--threshold-upper-boundary 0.99 \
--thresholds-reset \
${{ github.event_name == 'workflow_dispatch' && '--err' || '' }} \
--adapter rust_criterion \
--github-actions "${{ secrets.GITHUB_TOKEN }}" \
"cargo bench --manifest-path benches/Cargo.toml --bench latest_events_scanning"
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/target
/examples/**/target
.DS_Store

# Benchmark dumps - only commit compressed files
benches/dumps/*.json
!benches/dumps/*.metadata.json
Loading