Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cli/delete_cache: Remove files in parallel
Make use of the parallelized walk.Walk() function instead of RemoveAll() to remove files, this is significantly quicker. Additionally, get the directory size as we're deleting so we only run walk.Walk() once. Left over directories are still removed with RemoveAll() after all files have been deleted. If we could tweak the file walk to search depth first, we could append all directories to an array and then delete them with Remove() after all files have been removed which would be slightly faster. However, that is a micro optimization for the future. Before: 0m0.174s | Now: 0m0.081s (uncached, 720.1 MiB)
- Loading branch information