FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fs: use streaming directory processing in cp() by cjihrig · Pull Request #41351 · nodejs/node · GitHub

/ node Public

fs: use streaming directory processing in cp() - #41351

Merged
nodejs-github-bot merged 2 commits into
nodejs:masterfrom
cjihrig:cp
Dec 31, 2021
Merged

fs: use streaming directory processing in cp()#41351
nodejs-github-bot merged 2 commits into
nodejs:masterfrom
cjihrig:cp

Conversation

cjihrig commented Dec 29, 2021

Copy link
Copy Markdown
Contributor

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.

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.
nodejs-github-bot added fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run. labels Dec 29, 2021

bnb commented Dec 29, 2021

Copy link
Copy Markdown
Contributor

Would love to see perf metrics on this if you've got any handy 👀

mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

lgtm

Comment thread lib/internal/fs/cp/cp.js Outdated

cjihrig commented Dec 29, 2021

Copy link
Copy Markdown
Contributor Author

Would love to see perf metrics on this if you've got any handy

I don't have any. The readdir() based implementation should actually be faster.

Co-authored-by: Luigi Pinca <luigipinca@gmail.com>
lpinca added the request-ci Add this label to start a Jenkins CI on a PR. label Dec 29, 2021
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 29, 2021

This comment has been minimized.

Copy link
Copy Markdown
Collaborator

Mesteery added the commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. label Dec 29, 2021
cjihrig changed the title fs: use async directory processing in cp() fs: use streaming directory processing in cp() Dec 29, 2021

juanarbol left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Awesome!

Mesteery added the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label Dec 30, 2021
cjihrig added the commit-queue Add this label to land a pull request using GitHub Actions. label Dec 31, 2021
nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Dec 31, 2021
nodejs-github-bot merged commit d0c1176 into nodejs:master Dec 31, 2021

Copy link
Copy Markdown
Collaborator

Landed in d0c1176

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>
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>
danielleadams mentioned this pull request Feb 1, 2022
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
RyanZim pushed a commit to jprichardson/node-fs-extra that referenced this pull request Feb 10, 2024
* 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
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

Labels

author ready PRs that have at least one approval, no outstanding review comments, and a CI started. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants


Back | FazBrowse Home | New Git URL