Closed joebonrichie closed 1 year ago
Firstly we walk the path and create an array of files and directories, we then delete the array of files in parallel, then finally we delete the directories from the bottom up.
A few approaches were tried, this ended up being the fastest.
Test Case (Avg. 10 runs)
$ boulder build nano.yml $ cp /var/cache/boulder/root ~/root-testcase $ du -sh ~/root-testcase : 2.0 GiB
rmdirRecurse : 988ms deleteDir (old) : 940ms deleteDir (parallel) : 737ms
Tested on an NVME SSD, it's possible this may be slower on spinning rust.
I like it.
Firstly we walk the path and create an array of files and directories, we then delete the array of files in parallel, then finally we delete the directories from the bottom up.
A few approaches were tried, this ended up being the fastest.
Test Case (Avg. 10 runs)
$ boulder build nano.yml $ cp /var/cache/boulder/root ~/root-testcase $ du -sh ~/root-testcase : 2.0 GiB
rmdirRecurse : 988ms deleteDir (old) : 940ms deleteDir (parallel) : 737ms
Tested on an NVME SSD, it's possible this may be slower on spinning rust.