jprichardson / node-fs-extra

Node.js: extra methods for the fs object like copy(), remove(), mkdirs()
MIT License
9.43k stars 775 forks source link

Perf: copying dir contents in parallel #1026

Closed SukkaW closed 9 months ago

SukkaW commented 10 months ago

The PR uses a technique similar to #885 to speed up the recursive copy operation.

As fs-extra is built on top of graceful-fs, this change won't cause EMFILE: too many open files as graceful-fs will exponentially backoff and retry.

RyanZim commented 9 months ago

@manidlou bump

RyanZim commented 9 months ago

Published in v11.2.0!

SukkaW commented 9 months ago

@RyanZim ❤️

Too bad I can't port this change to Node.js' fs#cp. Node.js doesn't have graceful-fs, thus EMFILEcan not be avoided.

RyanZim commented 9 months ago

Too bad I can't port this change to Node.js' fs#cp. Node.js doesn't have graceful-fs, thus EMFILEcan not be avoided.

You'd have to implement a concurrency limit yourself, I guess.