Skip to content

Commit

Permalink
Share tokio runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
ndr-ds committed Nov 19, 2024
1 parent 1edf143 commit e47b25e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions linera-service/benches/transfers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

use criterion::{criterion_group, criterion_main, Criterion};
use futures::{
stream::{self, FuturesUnordered},
Stream, StreamExt,
};
use futures::{stream::FuturesUnordered, Stream, StreamExt};
use linera_base::{
data_types::Amount,
identifiers::{Account, ChainId, Owner},
Expand All @@ -20,10 +17,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;

Expand Down

0 comments on commit e47b25e

Please sign in to comment.