Skip to content

Commit

Permalink
Considerably speed up dua interactive by allowing to use all (logical…
Browse files Browse the repository at this point in the history
…) cores
  • Loading branch information
Byron committed Mar 25, 2020
1 parent b39f773 commit 085ae37
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions src/aggregate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/traverse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 085ae37

Please sign in to comment.