mirror of
https://github.com/bootandy/dust.git
synced 2026-06-08 11:29:05 +03:00
[PR #40] [MERGED] Use jwalk instead of walkdir: parallel walking for performance boost #269
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/bootandy/dust/pull/40
Author: @AdminXVII
Created: 11/25/2019
Status: ✅ Merged
Merged: 12/4/2019
Merged by: @bootandy
Base:
master← Head:parallel-walk📝 Commits (6)
86b3cccperf(IO): use parallel walkdir (jwalk) for super faster traversalf8ce6c9Use more rusty patterns and preallocate enough spacebf28d42Update Performance section of README62ac9b6Make sure to count the hidden directories19a41aaAdd CLI option for the number of threads to spawnb66523cApply clippy lints📊 Changes
7 files changed (+257 additions, -80 deletions)
View changed files
📝
Cargo.lock(+170 -14)📝
Cargo.toml(+1 -1)📝
README.md(+1 -1)📝
src/display.rs(+7 -7)📝
src/main.rs(+32 -26)📝
src/utils/mod.rs(+36 -26)📝
src/utils/platform.rs(+10 -5)📄 Description
Use a parallel walkdir implementation that is able to fetch more resources at the same time. This should greatly improve directory trees with lots of branching, at the cost of threading. Also make sure to allocate enough space as much as possible ahead of time to avoid reallocation. Lastly,
removeon a vec needs to make an allocation each time, so prefer the retain method for repeated removal.Some benchmark on my computer (galago pro 3):
Folder 1 (medium, shallow):
dust: 0.055011367s
du -sh: 0.245766881s
Folder 2 (small, shallow):
du -sh: 0.007830246s
dust: 0.025789946s
Folder 3 (large, deep):
dust: 3.421158887s
du -sh: 21.322613990s
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.