mirror of
https://github.com/bootandy/dust.git
synced 2026-06-08 11:29:05 +03:00
[GH-ISSUE #375] HDD performance is poor #166
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?
Originally created by @Davester47 on GitHub (Mar 14, 2024).
Original GitHub issue: https://github.com/bootandy/dust/issues/375
Performance of
dustcompared to single-threaded coreutilsduon my HDD is about 2x worse. I was testing on my home directory, which according to dust has 139,000 files for a total of 711 gigabytes. The filesystem is ext4.And for du:
I'm not sure what is causing the difference here, but I'm guessing it has to do with the directory traversal order used by the two programs.
duuses depth-first search, whereasdustappears to be using breadth-first search through rayon. Perhaps depth first search is more effective on mechanical HDDs?@bootandy commented on GitHub (Mar 15, 2024):
du is a simpler tool.
It's also ancient, highly crafted C code.
Disks, folder structures are all highly varied. I'm not surprised that du is sometimes faster.
If you run dust like this: you can see how long it takes to run in single threaded mode
$ export RAYON_NUM_THREADS=1; time dust /@Davester47 commented on GitHub (Mar 15, 2024):
I ran it like you said in single-threaded mode, and it was almost as fast as du! I guess something about the access pattern really disagrees with HDDs when it's running multi-threaded. I wouldn't suppose it'd be easy to change the order you go through the filesystem, would it?
@bootandy commented on GitHub (Mar 15, 2024):
Not really.
This breath first approach works quite well with Rayon, Removing the recursion might be sensible but I can't really move to depth first easily.