-
Notifications
You must be signed in to change notification settings - Fork 40
Convert unused ledger binary to proper criterion benchmarks #1539
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
Conversation
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
✓ Code Reference Verification PassedAll code references in the documentation have been verified successfully! Total references checked: 1 The documentation is in sync with the codebase on the |
OCaml Reference Validation ResultsRepository: https://github.com/MinaProtocol/mina.git Click to see full validation output
|
59246d3
to
8fc203d
Compare
Removed the unused src/bin/ledger.rs binary that was not integrated into the build system and converted it to proper Rust benchmarks using criterion following Rustacean best practices. Changes: - Removed ledger/src/bin/ledger.rs (unused binary) - Created ledger/benches/database.rs with criterion benchmarks for: * Account generation performance * Merkle root computation performance - Updated ledger/Cargo.toml: * Removed binary declaration * Added benchmark declaration * Added criterion to dev-dependencies - Added criterion to workspace Cargo.toml dependencies - Added Makefile targets: * build-benches: Build all benchmarks without running * build-bench-database: Build specific ledger database benchmark * bench: Run all benchmarks * bench-database: Run ledger database benchmark - Added CI workflows for building benchmarks: * bench-reusable.yaml: Reusable workflow using existing setup actions * bench-ubuntu-22-04.yaml: Runs on all events (PRs, pushes, etc.) * bench-ubuntu-24-04.yaml: Runs only on main/develop pushes * bench-ubuntu-24-04-arm.yaml: Runs only on main/develop pushes * bench-macos-latest.yaml: Runs only on main/develop pushes * bench-macos-13.yaml: Runs only on main/develop pushes * bench-macos-14.yaml: Runs only on main/develop pushes * bench-macos-15.yaml: Runs only on main/develop pushes The benchmarks can be run with: - cargo bench --bench database - make bench-database - make bench (for all benchmarks)
Instead of having separate workflow files for each platform's benchmarks, integrate benchmark building as a new job in the existing build-reusable workflow. This approach: - Reduces workflow file duplication - Reuses existing build caches for efficiency - Makes benchmarks depend on successful main build - Maintains benchmark builds across all platforms Changes: - Added build-benches job to build-reusable.yaml - Removed 8 separate bench-*.yaml workflow files - build-benches depends on build job and reuses its cache - Updated CHANGELOG to reflect the integration approach
Set sample_size(10) for both benchmark groups to reduce execution time in CI. This reduces samples from the default ~100 to 10, providing a reasonable balance between statistical accuracy and build time.
Created comprehensive benchmark documentation page organized by component (ledger). Added bash scripts for building and running benchmarks, which are verified in CI to ensure commands exist in Makefile. Documentation includes: - Overview of criterion-based benchmarking - Build and run instructions using bash scripts - Ledger database benchmark details (account generation and merkle root computation) CI verification added to test-docs-scripts workflow: - Verifies benchmark scripts are executable - Confirms make targets exist in Makefile - Does not run benchmarks to avoid long CI times
8fc203d
to
9eb385d
Compare
0xMimir
approved these changes
Oct 13, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Converts the unused
ledger/src/bin/ledger.rs
binary to proper Rust benchmarks using criterion, following Rustacean best practices.Running Benchmarks