fs: use streaming directory processing in cp()#41351
Merged
nodejs-github-bot merged 2 commits intonodejs:masterfrom Dec 31, 2021
Merged
fs: use streaming directory processing in cp()#41351nodejs-github-bot merged 2 commits intonodejs:masterfrom
nodejs-github-bot merged 2 commits intonodejs:masterfrom
Conversation
The readdir() functions do not scale well, which is why opendir(), etc. were introduced. This is exacerbated in the current cp() implementation, which calls readdir() recursively. This commit updates cp() to use the opendir() style iteration.
Contributor
|
Would love to see perf metrics on this if you've got any handy 👀 |
lpinca
approved these changes
Dec 29, 2021
bnb
approved these changes
Dec 29, 2021
lpinca
reviewed
Dec 29, 2021
addaleax
approved these changes
Dec 29, 2021
Contributor
Author
I don't have any. The |
Co-authored-by: Luigi Pinca <luigipinca@gmail.com>
This comment has been minimized.
This comment has been minimized.
Collaborator
27 tasks
VoltrexKeyva
approved these changes
Dec 30, 2021
26 tasks
Collaborator
|
Landed in d0c1176 |
This was referenced Jan 1, 2022
This was referenced Jan 4, 2022
targos
pushed a commit
that referenced
this pull request
Jan 14, 2022
The readdir() functions do not scale well, which is why opendir(), etc. were introduced. This is exacerbated in the current cp() implementation, which calls readdir() recursively. This commit updates cp() to use the opendir() style iteration. PR-URL: #41351 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Tierney Cyren <hello@bnb.im> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
danielleadams
pushed a commit
that referenced
this pull request
Jan 31, 2022
The readdir() functions do not scale well, which is why opendir(), etc. were introduced. This is exacerbated in the current cp() implementation, which calls readdir() recursively. This commit updates cp() to use the opendir() style iteration. PR-URL: #41351 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Tierney Cyren <hello@bnb.im> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Linkgoron
pushed a commit
to Linkgoron/node
that referenced
this pull request
Jan 31, 2022
The readdir() functions do not scale well, which is why opendir(), etc. were introduced. This is exacerbated in the current cp() implementation, which calls readdir() recursively. This commit updates cp() to use the opendir() style iteration. PR-URL: nodejs#41351 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Tierney Cyren <hello@bnb.im> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
danielleadams
pushed a commit
that referenced
this pull request
Feb 1, 2022
The readdir() functions do not scale well, which is why opendir(), etc. were introduced. This is exacerbated in the current cp() implementation, which calls readdir() recursively. This commit updates cp() to use the opendir() style iteration. PR-URL: #41351 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Tierney Cyren <hello@bnb.im> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Merged
SukkaW
added a commit
to SukkaW/node-fs-extra
that referenced
this pull request
Nov 28, 2023
SukkaW
added a commit
to SukkaW/node-fs-extra
that referenced
this pull request
Nov 28, 2023
vrecomet
added a commit
to vrecomet/Metaln00b1
that referenced
this pull request
May 17, 2025
* refactor(copy): backport nodejs/node#41351 * perf(copy): parallel copy * perf(copy): run filter in parallel as well
baiiiiiiix
pushed a commit
to baiiiiiiix/Documentation
that referenced
this pull request
May 17, 2025
* refactor(copy): backport nodejs/node#41351 * perf(copy): parallel copy * perf(copy): run filter in parallel as well
neysidevhcr1j
added a commit
to neysidevhcr1j/neysidevhcr1j
that referenced
this pull request
May 20, 2025
* refactor(copy): backport nodejs/node#41351 * perf(copy): parallel copy * perf(copy): run filter in parallel as well
KennetYoung
added a commit
to KennetYoung/ingeni
that referenced
this pull request
Jun 10, 2025
* refactor(copy): backport nodejs/node#41351 * perf(copy): parallel copy * perf(copy): run filter in parallel as well
criticalPathway
pushed a commit
to criticalPathway/node-fs-extra
that referenced
this pull request
Nov 17, 2025
* refactor(copy): backport nodejs/node#41351 * perf(copy): parallel copy * perf(copy): run filter in parallel as well
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
readdir()functions do not scale well, which is whyopendir(), etc. were introduced. This is exacerbated in the currentcp()implementation, which callsreaddir()recursively.This commit updates
cp()to use theopendir()style iteration.