summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Thiel <sebastian.thiel@icloud.com>2020-03-26 07:57:16 +0800
committerSebastian Thiel <sebastian.thiel@icloud.com>2020-03-26 07:57:16 +0800
commit085ae37d70bbd4328e046a47bc41c13e669eb562 (patch)
tree0d048e6c1b1569370c7452a1d71b5341ae1dd125
parentb39f7738d45b2627cddd4e026bde6342a7535ccf (diff)
Considerably speed up dua interactive by allowing to use all (logical) cores
-rw-r--r--src/aggregate.rs10
-rw-r--r--src/traverse.rs2
2 files changed, 5 insertions, 7 deletions
diff --git a/src/aggregate.rs b/src/aggregate.rs
index 1da708c..101e45b 100644
--- a/src/aggregate.rs
+++ b/src/aggregate.rs
@@ -37,12 +37,10 @@ pub fn aggregate(
if options.apparent_size {
m.len()
} else {
- entry.path().size_on_disk_fast(m).unwrap_or_else(
- |_| {
- num_errors += 1;
- 0
- },
- )
+ entry.path().size_on_disk_fast(m).unwrap_or_else(|_| {
+ num_errors += 1;
+ 0
+ })
}
}
Some(Ok(_)) => 0,
diff --git a/src/traverse.rs b/src/traverse.rs
index 4b73147..a332088 100644
--- a/src/traverse.rs
+++ b/src/traverse.rs
@@ -76,7 +76,7 @@ impl Traversal {
if walk_options.threads == 0 {
// avoid using the global rayon pool, as it will keep a lot of threads alive after we are done.
// Also means that we will spin up a bunch of threads per root path, instead of reusing them.
- walk_options.threads = num_cpus::get_physical();
+ walk_options.threads = num_cpus::get();
}
for path in input.into_iter() {
let mut last_seen_eid = 0;