Skip to content

Commit b8d4c16

Browse files
authored
Merge pull request #1539 from o1-labs/add-criterion-benchmarks
Convert unused ledger binary to proper criterion benchmarks
2 parents 8e05651 + 9eb385d commit b8d4c16

File tree

14 files changed

+434
-33
lines changed

14 files changed

+434
-33
lines changed

.github/workflows/build-reusable.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,33 @@ jobs:
131131
- name: Build tests
132132
run: make build-tests-webrtc
133133

134+
build-benches:
135+
needs: [build]
136+
timeout-minutes: 60
137+
runs-on: ${{ inputs.os }}
138+
env:
139+
RUSTFLAGS: "-C overflow-checks=off -C debug-assertions=off ${{ inputs.rustflags }}"
140+
steps:
141+
- name: Git checkout
142+
uses: actions/checkout@v5
143+
144+
- name: Setup build dependencies
145+
uses: ./.github/actions/setup-build-deps
146+
147+
- name: Use shared OCaml setting up steps
148+
uses: ./.github/actions/setup-ocaml
149+
with:
150+
ocaml_version: ${{ inputs.ocaml_version }}
151+
152+
- name: Setup Rust
153+
uses: ./.github/actions/setup-rust
154+
with:
155+
toolchain: 1.84
156+
cache-prefix: build-${{ inputs.os }}-${{ inputs.cache-prefix }}v0
157+
158+
- name: Build benchmarks
159+
run: make build-benches
160+
134161
build-wasm:
135162
if: ${{ inputs.build-wasm }}
136163
timeout-minutes: 60

.github/workflows/test-docs-scripts.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,29 @@ jobs:
221221
# We'll just check if it was installed via Homebrew
222222
docker --version || echo "Docker installed but not running (expected on macOS CI)"
223223
224+
test-benchmark-commands:
225+
name: Verify Benchmark Commands
226+
runs-on: ubuntu-latest
227+
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'test-doc-scripts')
228+
229+
steps:
230+
- name: Checkout repository
231+
uses: actions/checkout@v5
232+
233+
- name: Verify benchmark scripts and commands
234+
run: |
235+
# Check if scripts exist and are executable
236+
test -x ./website/docs/developers/scripts/benchmarks/build-benchmarks.sh
237+
test -x ./website/docs/developers/scripts/benchmarks/run-all-benchmarks.sh
238+
test -x ./website/docs/developers/scripts/benchmarks/run-database-benchmark.sh
239+
240+
# Verify the make targets referenced in scripts exist in Makefile
241+
grep -q "^build-benches:" Makefile
242+
grep -q "^bench:" Makefile
243+
grep -q "^bench-database:" Makefile
244+
245+
echo "SUCCESS: All benchmark commands verified"
246+
224247
test-update-ocaml-node-script:
225248
name: Test Update OCaml Node Script
226249
runs-on: ${{ matrix.os }}

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7575
([#1528](https://github.com/o1-labs/mina-rust/pull/1528/))
7676
- **Codebase**: remove unused `ledger/src/poseidon/fp.rs` file
7777
([#1538](https://github.com/o1-labs/mina-rust/pull/1538))
78+
- **Ledger**: convert unused binary to proper criterion benchmarks. Benchmarks
79+
are now built as part of the existing build workflows across all platforms,
80+
reusing build caches for efficiency
81+
([#1539](https://github.com/o1-labs/mina-rust/pull/1539))
7882

7983
## v0.17.0
8084

0 commit comments

Comments
 (0)