getsolus / solbuild

The Solus package build system
https://getsol.us
Apache License 2.0
19 stars 12 forks source link

cli/delete-cache: Switch to fastwalk #90

Open joebonrichie opened 5 months ago

joebonrichie commented 5 months ago

Use a parallelized version to fileWalk to get directory sizes. Additionally, use the parallelized version of fileWalk to delete files, then call RemoveAll() on the remaining empty directories.

Resolves #89.

Benchmarks solbuild dc -a (720.1 MiB)

Before: 0m0.174s | Now: 0m0.081s (uncached)

solbuild dc -s (41.8 GiB)

Before : 0m15.849s (uncached) | 0m6.241s (cached) After : 0m2.134s (uncached) | 0m0.585s (cached)

joebonrichie commented 5 months ago

I see there are a couple of alternatives which have been maintained more recently:

https://github.com/saracen/walker https://github.com/charlievieth/fastwalk

Will report back

ermo commented 4 months ago

@joebonrichie Appears to need a rebase. ^^'