chore: Adjust WalkParallel heuristic for multithreading

See also https://github.com/BurntSushi/ripgrep/blob/71d71d2d98964653cdfcfa315802f518664759d7/crates/core/flags/hiargs.rs#L172

Closes #2854
This commit is contained in:
Alex Povel
2024-07-17 09:48:42 +02:00
parent 71d71d2d98
commit 038574004a
+1 -1
View File
@@ -1305,7 +1305,7 @@ impl WalkParallel {
fn threads(&self) -> usize {
if self.threads == 0 {
2
std::thread::available_parallelism().map_or(1, |n| n.get()).min(12)
} else {
self.threads
}