// Benchmark for a 10K burst task spawn
Benchmark for a 10K burst task spawn
Benchmark for a 10K burst task spawn
fn _blocking(b: &mut Bencher) {
    b.iter(|| {
        (0..10_000)
            .map(|_| {
                blocking::spawn_blocking(
                    async {
                        let duration = Duration::from_millis(1);
                        thread::sleep(duration);
                    },
                    ProcStack::default(),
                )
            })
            .collect::<Vec<_>>()
    });
}
fn _blocking ( b : & mut Bencher ) { b . iter ( | | { ( 0 .. 10_000 ) . map ( | _ | { blocking :: spawn_blocking ( async { let duration = Duration :: from_millis ( 1 ) ; thread :: sleep ( duration ) ; } , ProcStack :: default ( ) , ) } ) . collect :: < Vec < _ > > ( ) } ) ; }
Benchmark for a 10K burst task spawn
Benchmark for a 10K burst task spawn
b
&mut Bencher