Merge pull request #2888 from ProvableHQ/test/records-calls-with-cycles #755
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
name: Run snarkVM Benchmarks | |
on: | |
push: | |
branches: | |
- 'staging' | |
- 'bench/rust-toolchain' | |
workflow_dispatch: | |
jobs: | |
# Run benchmarks and stores the output to a file | |
benchmark: | |
name: Benchmark | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v5 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install required Debian pacakges | |
run: sudo apt install -y lld | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo-bench-${{ hashFiles('**/Cargo.lock') }} | |
- name: Benchmark algorithms | |
run: | | |
cd algorithms | |
cargo bench --bench variable_base -- --output-format bencher | tee -a ../output.txt | |
cargo bench --bench poseidon_sponge -- --output-format bencher | tee -a ../output.txt | |
cargo bench --bench varuna -- --output-format bencher | tee -a ../output.txt | |
cd .. | |
- name: Benchmark circuit/environment | |
run: | | |
cd circuit/environment | |
cargo bench --bench linear_combination -- --output-format bencher | tee -a ../../output.txt | |
cd ../.. | |
- name: Benchmark console/account | |
run: | | |
cd console/account | |
cargo bench --bench account -- --output-format bencher | tee -a ../../output.txt | |
cd ../.. | |
- name: Benchmark console/algorithms | |
run: | | |
cd console/algorithms | |
cargo bench --bench poseidon -- --output-format bencher | tee -a ../../output.txt | |
cargo bench --bench elligator2 -- --output-format bencher | tee -a ../../output.txt | |
cd ../.. | |
- name: Benchmark console/collections | |
run: | | |
cd console/collections | |
cargo bench --bench merkle_tree -- --output-format bencher | tee -a ../../output.txt | |
cd ../.. | |
- name: Benchmark console/types | |
run: | | |
cd console/types | |
cargo bench --bench group -- --output-format bencher | tee -a ../../output.txt | |
cd ../.. | |
- name: Benchmark curves | |
run: | | |
cd curves | |
cargo bench --bench curves -- --output-format bencher | tee -a ../output.txt | |
cd .. | |
- name: Benchmark ledger | |
run: | | |
cd ledger | |
cargo bench --bench block -- --output-format bencher | tee -a ../output.txt | |
cargo bench --bench transaction -- --output-format bencher | tee -a ../output.txt | |
cd .. | |
- name: Benchmark ledger/puzzle | |
run: | | |
cd ledger/puzzle | |
cargo bench --bench puzzle --features "setup" -- --output-format bencher | tee -a ../../output.txt | |
cd ../.. | |
# Clean benchmark output to remove unnecessary lines | |
- name: Clean benchmark output | |
run: | | |
sed -n -i '/bench:/p' output.txt | |
# Download previous benchmark result from cache (if exists) | |
- name: Download previous benchmark data | |
uses: actions/cache@v4 | |
with: | |
path: ./cache | |
key: ${{ runner.os }}-benchmark | |
- name: Store benchmark result | |
uses: benchmark-action/github-action-benchmark@v1 | |
with: | |
name: snarkVM Benchmarks | |
tool: 'cargo' | |
output-file-path: output.txt | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
auto-push: true | |
alert-threshold: '150%' | |
comment-on-alert: true | |
fail-on-alert: true | |
alert-comment-cc-users: '@raychu86' |