File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
mithril-aggregator/benches Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -39,22 +39,25 @@ fn generate_transactions(nb_transactions: usize) -> Vec<CardanoTransaction> {
39
39
}
40
40
41
41
fn bench_store_transactions ( c : & mut Criterion ) {
42
- const NB_CARDANO_TRANSACTIONS : usize = 100000 ;
42
+ const NB_CARDANO_TRANSACTIONS : usize = 1_000_000 ;
43
43
let runtime = tokio:: runtime:: Runtime :: new ( ) . unwrap ( ) ;
44
+ let transactions = generate_transactions ( NB_CARDANO_TRANSACTIONS ) ;
44
45
45
46
let mut group = c. benchmark_group ( "Store transactions" ) ;
46
47
group. bench_function ( "store_transactions" , |bencher| {
47
48
bencher. to_async ( & runtime) . iter ( || async {
48
49
let connection = Arc :: new ( cardano_tx_db_connection ( ) ) ;
49
50
let repository = CardanoTransactionRepository :: new ( connection) ;
50
- repository
51
- . store_transactions ( generate_transactions ( NB_CARDANO_TRANSACTIONS ) )
52
- . await
51
+ repository. store_transactions ( transactions. clone ( ) ) . await
53
52
} ) ;
54
53
} ) ;
55
54
56
55
group. finish ( ) ;
57
56
}
58
57
59
- criterion_group ! ( benches, bench_store_transactions) ;
58
+ criterion_group ! {
59
+ name = benches;
60
+ config = Criterion :: default ( ) . sample_size( 10 ) ;
61
+ targets = bench_store_transactions
62
+ }
60
63
criterion_main ! ( benches) ;
You can’t perform that action at this time.
0 commit comments