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> {
3939}
4040
4141fn bench_store_transactions ( c : & mut Criterion ) {
42- const NB_CARDANO_TRANSACTIONS : usize = 100000 ;
42+ const NB_CARDANO_TRANSACTIONS : usize = 1_000_000 ;
4343 let runtime = tokio:: runtime:: Runtime :: new ( ) . unwrap ( ) ;
44+ let transactions = generate_transactions ( NB_CARDANO_TRANSACTIONS ) ;
4445
4546 let mut group = c. benchmark_group ( "Store transactions" ) ;
4647 group. bench_function ( "store_transactions" , |bencher| {
4748 bencher. to_async ( & runtime) . iter ( || async {
4849 let connection = Arc :: new ( cardano_tx_db_connection ( ) ) ;
4950 let repository = CardanoTransactionRepository :: new ( connection) ;
50- repository
51- . store_transactions ( generate_transactions ( NB_CARDANO_TRANSACTIONS ) )
52- . await
51+ repository. store_transactions ( transactions. clone ( ) ) . await
5352 } ) ;
5453 } ) ;
5554
5655 group. finish ( ) ;
5756}
5857
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+ }
6063criterion_main ! ( benches) ;
You can’t perform that action at this time.
0 commit comments