1- use criterion:: { criterion_group , criterion_main , BenchmarkId , Criterion } ;
1+ use criterion:: { BenchmarkId , Criterion , criterion_group , criterion_main } ;
22
33#[ allow( dead_code) ]
44fn test_add ( x : usize ) -> usize {
@@ -18,12 +18,7 @@ struct BigData {
1818
1919#[ allow( dead_code, unused_variables) ]
2020#[ allow( dead_code) ]
21- async fn crossbeam (
22- msg_vecs : Vec < Vec < BigData > > ,
23- c : usize ,
24- task_count : usize ,
25- msg_count : usize ,
26- ) {
21+ async fn crossbeam ( msg_vecs : Vec < Vec < BigData > > , c : usize , task_count : usize , msg_count : usize ) {
2722 // let (s, r) = bounded_async(c);
2823 // let queue = crossbeam::queue::ArrayQueue::new(c);
2924 // let mut handles = Vec::new();
@@ -109,16 +104,12 @@ fn benchmark_crossbeam(c: &mut Criterion) {
109104
110105 // todo!();
111106 // }
112- c. bench_with_input (
113- BenchmarkId :: new ( "Crossbeam" , 0 ) ,
114- & ( 0 ) ,
115- |b, & cap| {
116- // Insert a call to `to_async` to convert the bencher to async mode.
117- // The timing loops are the same as with the normal bencher.
118- // let msg_vec_clone = msg_vecs.clone();
119- b. iter ( || sync_crossbeam ( ) )
120- } ,
121- ) ;
107+ c. bench_with_input ( BenchmarkId :: new ( "Crossbeam" , 0 ) , & ( 0 ) , |b, & cap| {
108+ // Insert a call to `to_async` to convert the bencher to async mode.
109+ // The timing loops are the same as with the normal bencher.
110+ // let msg_vec_clone = msg_vecs.clone();
111+ b. iter ( || sync_crossbeam ( ) )
112+ } ) ;
122113}
123114
124115criterion_group ! ( benches, benchmark_crossbeam) ;
0 commit comments