Use as many threads as logical cores for achieving full utilization (#1897)
This commit is contained in:
parent
4df74e85ef
commit
d54c18b80c
|
@ -42,5 +42,5 @@ Throughput: 5,075,400 iterations/sec
|
|||
"stats" - Prints memory and CPU usage. Has slight impact on throughput.
|
||||
|
||||
```sh
|
||||
cargo run --release --bin metrics --feature=stats
|
||||
cargo run --release --bin metrics --features=stats
|
||||
```
|
||||
|
|
|
@ -126,7 +126,7 @@ where
|
|||
|
||||
handles.push(handle_main_thread);
|
||||
|
||||
for thread_index in 0..num_threads - 1 {
|
||||
for thread_index in 0..num_threads {
|
||||
let worker_stats_shared = Arc::clone(&worker_stats_shared);
|
||||
let func_arc_clone = Arc::clone(&func_arc);
|
||||
let handle = thread::spawn(move || loop {
|
||||
|
|
Loading…
Reference in New Issue