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

fs: add `bufferSize` option to `fs.opendir()` by addaleax · Pull Request #30114 · nodejs/node · GitHub

/ node Public

fs: add bufferSize option to fs.opendir() - #30114

Closed
addaleax wants to merge 7 commits into
nodejs:masterfrom
addaleax:fs-opendir-buffersize
Closed

fs: add bufferSize option to fs.opendir()#30114
addaleax wants to merge 7 commits into
nodejs:masterfrom
addaleax:fs-opendir-buffersize

Conversation

Copy link
Copy Markdown
Member

Add an option that controls the size of the internal
buffer.

Fixes: #29941

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Add an option that controls the size of the internal
buffer.

Fixes: nodejs#29941
nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. fs Issues and PRs related to the fs subsystem / file system. labels Oct 25, 2019

Copy link
Copy Markdown

What a mob programming session 🙌🏻😀

jdjuan commented Oct 25, 2019

Copy link
Copy Markdown

300 people watched the process of this PR during @scriptconf Great job!!!!!

Comment thread doc/api/fs.md Outdated
Comment thread doc/api/fs.md Outdated
Comment thread doc/api/fs.md Outdated
Comment thread doc/api/fs.md Outdated
Comment thread doc/api/fs.md Outdated
Comment thread doc/api/fs.md Outdated

drdreo commented Oct 25, 2019

Copy link
Copy Markdown

Can approve that all tests were done

Copy link
Copy Markdown
Collaborator

Trott commented Oct 25, 2019

Copy link
Copy Markdown
Member

bufferSize will need to be added to test/benchmark/test-benchmark-fs.js

Speaking of which: Needs tests. (Just forgot to git add them maybe? You checked the box for tests and I know it's not like you to not have tests. :-D )

Comment thread doc/api/fs.md Outdated

Copy link
Copy Markdown
Member Author

bufferSize will need to be added to test/benchmark/test-benchmark-fs.js

Done, thanks!

Speaking of which: Needs tests. (Just forgot to git add them maybe? You checked the box for tests and I know it's not like you to not have tests. :-D )

I checked the box because I added benchmarks that measure the performance impact – I don’t think this is something that we could test for well without digging into internals.

addaleax requested a review from Fishrock123 October 25, 2019 20:39
addaleax added the semver-minor PRs that contain new features and should be released in the next minor version. label Oct 25, 2019

Copy link
Copy Markdown
Member

bufferSize will need to be added to test/benchmark/test-benchmark-fs.js

Done, thanks!

Speaking of which: Needs tests. (Just forgot to git add them maybe? You checked the box for tests and I know it's not like you to not have tests. :-D )

I checked the box because I added benchmarks that measure the performance impact – I don’t think this is something that we could test for well without digging into internals.

Test passing non-numbers/negative numbers/zero/non-integers as bufferSize?

Trott commented Oct 25, 2019
edited
Loading

Copy link
Copy Markdown
Member

Test passing non-numbers/negative numbers/zero/non-integers as bufferSize?

And maybe one test for 32 and one other reasonable positive integer to confirm that it doesn't throw in those cases?

Copy link
Copy Markdown
Member Author

@Trott @richardlau I guess, yes – added tests for the error condition/that it works when using a positive integer value.

Comment thread test/parallel/test-fs-opendir.js Outdated
Co-Authored-By: Richard Lau <riclau@uk.ibm.com>
addaleax added the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label Oct 26, 2019

Copy link
Copy Markdown
Collaborator

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

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Member Author

Landed in b35181f 🎉

addaleax closed this Oct 28, 2019
addaleax added a commit that referenced this pull request Oct 28, 2019
Add an option that controls the size of the internal
buffer.

Fixes: #29941

PR-URL: #30114
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
addaleax deleted the fs-opendir-buffersize branch October 28, 2019 13:35
targos pushed a commit that referenced this pull request Nov 5, 2019
Add an option that controls the size of the internal
buffer.

Fixes: #29941

PR-URL: #30114
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
targos added a commit that referenced this pull request Nov 5, 2019
Notable changes:

* cli:
  * Added a new flag (`--trace-uncaught`) that makes Node.js print the
    stack trace at the time of throwing uncaught exceptions, rather than
    at the creation of the `Error` object, if there is any. This is
    disabled by default because it affects GC behavior.
    #30025
* crypto
  * Added `Hash.prototype.copy()` method. It returns a new `Hash` object
    with its internal state cloned from the original one.
    #29910
* dgram
  * Added source-specific multicast support. This adds methods to
    Datagram sockets to support RFC 4607
    (https://tools.ietf.org/html/rfc4607) for IPv4 and IPv6.
    #15735
* fs
  * Added a `bufferSize` option to `fs.opendir()`. It allows to control
    the number of entries that are buffered internally when reading from
    the directory. #30114
* meta
  * Added Chengzhong Wu (https://github.com/legendecas) to
    collaborators. #30115

PR-URL: #30262
targos mentioned this pull request Nov 5, 2019
targos added a commit that referenced this pull request Nov 5, 2019
Notable changes:

* cli:
  * Added a new flag (`--trace-uncaught`) that makes Node.js print the
    stack trace at the time of throwing uncaught exceptions, rather than
    at the creation of the `Error` object, if there is any. This is
    disabled by default because it affects GC behavior.
    #30025
* crypto
  * Added `Hash.prototype.copy()` method. It returns a new `Hash` object
    with its internal state cloned from the original one.
    #29910
* dgram
  * Added source-specific multicast support. This adds methods to
    Datagram sockets to support RFC 4607
    (https://tools.ietf.org/html/rfc4607) for IPv4 and IPv6.
    #15735
* fs
  * Added a `bufferSize` option to `fs.opendir()`. It allows to control
    the number of entries that are buffered internally when reading from
    the directory. #30114
* meta
  * Added Chengzhong Wu (https://github.com/legendecas) to
    collaborators. #30115

PR-URL: #30262
MylesBorins pushed a commit that referenced this pull request Jan 12, 2020
Add an option that controls the size of the internal
buffer.

Fixes: #29941

PR-URL: #30114
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
BethGriggs pushed a commit that referenced this pull request Feb 6, 2020
Add an option that controls the size of the internal
buffer.

Fixes: #29941

PR-URL: #30114
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
MylesBorins mentioned this pull request Feb 8, 2020
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. c++ Issues and PRs that require attention from people who are familiar with C++. fs Issues and PRs related to the fs subsystem / file system. semver-minor PRs that contain new features and should be released in the next minor version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fs.Dir.read() is very slow

10 participants


Back | FazBrowse Home | New Git URL