diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 35062d01a8e..18921aa02e0 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -3,6 +3,16 @@ name: Benchmarks on: push: branches: [ main, 'devnet_*', 'testnet_*' ] + pull_request: + branches: + - "**" + paths-ignore: + - 'CONTRIBUTING.md' + - 'INSTALL.md' + - 'docker/**' + - 'docker_scylla/**' + - 'configuration/**' + - 'kubernetes/**' workflow_dispatch: env: @@ -17,12 +27,6 @@ jobs: steps: - uses: actions/checkout@v3 - uses: actions-rust-lang/setup-rust-toolchain@v1 - - name: Clear up some space - run: | - sudo rm -rf /usr/share/dotnet - sudo rm -rf /opt/ghc - sudo rm -rf "/usr/local/share/boost" - sudo rm -rf "$AGENT_TOOLSDIRECTORY" - name: Install Protoc uses: arduino/setup-protoc@v1 with: diff --git a/linera-service/benches/transfers.rs b/linera-service/benches/transfers.rs index f17e23eed83..bbcf1a1185b 100644 --- a/linera-service/benches/transfers.rs +++ b/linera-service/benches/transfers.rs @@ -20,10 +20,11 @@ fn cross_chain_native_token_transfers(criterion: &mut Criterion) { let chain_count = 100; let accounts_per_chain = 1; let transfers_per_account = 100; + let runtime = Runtime::new().expect("Failed to create Tokio runtime"); criterion.bench_function("same_chain_native_token_transfers", |bencher| { bencher - .to_async(Runtime::new().expect("Failed to create Tokio runtime")) + .to_async(&runtime) .iter_custom(|iterations| async move { let mut total_time = Duration::ZERO; @@ -146,5 +147,10 @@ fn prepare_transfers( .collect::>() } -criterion_group!(benches, cross_chain_native_token_transfers); +criterion_group!( + name = benches; + config = Criterion::default() + .measurement_time(Duration::from_secs(180)); + targets = cross_chain_native_token_transfers +); criterion_main!(benches);