-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[v14.x backport] fs: improve fsPromises readFile performance #37703
Closed
Conversation
This file contains 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
nodejs-github-bot
added
fs
Issues and PRs related to the fs subsystem / file system.
needs-ci
PRs that need a full CI run.
v14.x
labels
Mar 10, 2021
Linkgoron
force-pushed
the
backport-37608-to-v14.x
branch
from
March 10, 2021 23:57
fd69e7b
to
afd0b68
Compare
Benchmark numbers:
|
Linkgoron
added a commit
to Linkgoron/node
that referenced
this pull request
Mar 11, 2021
Improve the fsPromises readFile performance by allocating only one buffer, when size is known, increase the size of the readbuffer chunks, and dont read more data if size bytes have been read refs: nodejs#37583 Backport-PR-URL: nodejs#37703 PR-URL: nodejs#37608
Linkgoron
force-pushed
the
backport-37608-to-v14.x
branch
from
March 11, 2021 00:58
afd0b68
to
1d81990
Compare
|
MylesBorins
force-pushed
the
v14.x-staging
branch
from
April 6, 2021 19:54
11505ad
to
6b115d7
Compare
Improve the fsPromises readFile performance by allocating only one buffer, when size is known, increase the size of the readbuffer chunks, and dont read more data if size bytes have been read refs: nodejs#37583 Backport-PR-URL: nodejs#37703 PR-URL: nodejs#37608
Linkgoron
force-pushed
the
backport-37608-to-v14.x
branch
from
April 9, 2021 08:59
1d81990
to
63c43b0
Compare
This PR is actually what started my quest of backporting AbortController 😄 |
MoritzLoewenstein
added a commit
to MoritzLoewenstein/node
that referenced
this pull request
Aug 21, 2021
Improve the fsPromises readFile performance by allocating only one buffer, when size is known, increase the size of the readbuffer chunks, and dont read more data if size bytes have been read. Also moves constants to internal/fs/utils. refs: nodejs#37583 (Old) Backport-PR-URL: nodejs#37703 PR-URL: nodejs#37608
MoritzLoewenstein
added a commit
to MoritzLoewenstein/node
that referenced
this pull request
Aug 21, 2021
Improve the fsPromises readFile performance by allocating only one buffer, when size is known, increase the size of the readbuffer chunks, and dont read more data if size bytes have been read. Also moves constants to internal/fs/utils. refs: nodejs#37583 (Old) Backport-PR-URL: nodejs#37703 PR-URL: nodejs#37608
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.
Improve the fsPromises readFile performance
by allocating only one buffer, when size is known,
increase the size of the readbuffer chunks,
and dont read more data if size bytes have been read
refs: #37583
PR-URL: #37608
I only cherry-picked the changes to
fs/promises.js
(first commit) but didn't backport the benchmark (second commit). If that's needed, I'll be happy to do it as well. This PR also incorporates the changes of #37127, so I'm not sure if that PR should be backported before this one.