Question: rmdir recursive - is it safe to parallelize?
See original GitHub issueI see that the rmdir
method can remove recursively. However, I need to remove a very large tree. Because this function does an await
on every delete, it is painfully slow for my use case.
Just wonder if you happen to know if this operation is safe to parallelize? Even if I have to manually implement a limit that be ok.
Issue Analytics
- State:
- Created a year ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Parallelize recursive deletion with find - Unix Stack Exchange
Save this question. Show activity on this post. I want to recursively delete all files that end with .
Read more >Doing an rm -rf on a massive directory tree takes hours
No. rm -rf does a recursive depth-first traversal of your filesystem, calling unlink() on every file. The two operations that cause the ...
Read more >Is node.js rmdir recursive ? Will it work on non empty ...
I don't know if it's me or a general problem, but files inside deleted directory will act very odd. after rmdirSync is done,...
Read more >Parallel Builds - redo: a recursive build system
Parallelism if more than one target depends on the same subdir. Recursive make is especially painful when it comes to parallelism.
Read more >The Pitfalls and Benefits of GNU Make Parallelization
The classic recursive Make style that uses a shell for loop processes each sub-Make in turn which doesn't allow more than one sub-Make...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just about to push v8.0.0, so closing this issue now.
I have made some changes to the rmdir method which might help your use case. Two main tings I have done are
The actual removal of directories is still synchronous because the recursive nature makes it too easy to blow out when there is a deep tree and many recursive calls.
I would be great if you could try this out and see if it helps your use case or not. The updated code is in the github repository under the branch called ‘rmdir-performance’. Be great to have it tested on a large directory tree.