File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,6 @@ async-channel = "1.4.1"
27
27
async-io = " 1.1.9"
28
28
criterion = { version = " 0.4.0" , default-features = false , features = [" cargo_bench_support" ] }
29
29
easy-parallel = " 3.1.0"
30
- num_cpus = " 1.13.0"
31
30
once_cell = " 1.16.0"
32
31
33
32
[[bench ]]
Original file line number Diff line number Diff line change 1
1
use std:: future:: Future ;
2
+ use std:: thread:: available_parallelism;
2
3
3
4
use async_executor:: Executor ;
4
5
use criterion:: { criterion_group, criterion_main, Criterion } ;
@@ -11,7 +12,11 @@ const LIGHT_TASKS: usize = 25_000;
11
12
static EX : Executor < ' _ > = Executor :: new ( ) ;
12
13
13
14
fn run ( f : impl FnOnce ( ) , multithread : bool ) {
14
- let limit = if multithread { num_cpus:: get ( ) } else { 1 } ;
15
+ let limit = if multithread {
16
+ available_parallelism ( ) . unwrap ( ) . get ( )
17
+ } else {
18
+ 1
19
+ } ;
15
20
16
21
let ( s, r) = async_channel:: bounded :: < ( ) > ( 1 ) ;
17
22
easy_parallel:: Parallel :: new ( )
You can’t perform that action at this time.
0 commit comments