Skip to content

Commit

Permalink
reduce num_threads
Browse files Browse the repository at this point in the history
  • Loading branch information
fgimenez committed Dec 17, 2024
1 parent 156951e commit d2372a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/trie/parallel/src/proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ where
);
let storage_root_targets_len = storage_root_targets.len();

let num_threads = std::thread::available_parallelism()
.map_or(0, |num| num.get().saturating_sub(1).max(1));
let num_threads =
std::thread::available_parallelism().map_or(1, |num| (num.get() / 2).max(1));

// create a local thread pool with a fixed number of workers
let pool = rayon::ThreadPoolBuilder::new()
Expand Down

0 comments on commit d2372a3

Please sign in to comment.