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

fs: improve error performance of `fchownSync` by evelez7 · Pull Request #49920 · nodejs/node · GitHub

/ node Public

fs: improve error performance of fchownSync - #49920

Closed
evelez7 wants to merge 3 commits into
nodejs:mainfrom
evelez7:perf-fchownSync
Closed

fs: improve error performance of fchownSync#49920
evelez7 wants to merge 3 commits into
nodejs:mainfrom
evelez7:perf-fchownSync

Conversation

evelez7 commented Sep 28, 2023
edited
Loading

Copy link
Copy Markdown

Credit to @CanadaHonk for the benchmark using file descriptors.

fs/bench-fchownSync.js n=1000 type='existing'                    -4.45 %      ±10.42% ±13.91% ±18.21%
fs/bench-fchownSync.js n=1000 type='non-existing'        ***    107.40 %       ±5.36%  ±7.19%  ±9.48%

Ref: nodejs/performance#106

nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Sep 28, 2023
anonrig added the request-ci Add this label to start a Jenkins CI on a PR. label Sep 28, 2023
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 28, 2023

Copy link
Copy Markdown
Collaborator

anonrig added the performance Issues and PRs related to the performance of Node.js. label Sep 28, 2023

evelez7 commented Sep 29, 2023
edited
Loading

Copy link
Copy Markdown
Author

Fixed error by moving validation back to fs.js and corrected types in node_file.cc.

anonrig commented Sep 30, 2023

Copy link
Copy Markdown
Member

Hey @evelez7, can you handle the conflicts? You'll see that sync.js file is removed on main branch.

anonrig commented Sep 30, 2023

Copy link
Copy Markdown
Member

@evelez7 Your changes include the fs/sync.js file. Can you remove it?

evelez7 commented Sep 30, 2023

Copy link
Copy Markdown
Author

@evelez7 Your changes include the fs/sync.js file. Can you remove it?

Sorry about that, thought it was removed in the rebase.

try {
return fs.openSync(x, 'r');
} catch {
return 1 << 30;

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

Shouldn't this only be part of the non-existing case?

Comment thread src/node_file.cc
int err = uv_fs_fchown(nullptr, &req, fd, uid, gid, nullptr);
FS_SYNC_TRACE_END(fchown);
if (err < 0) {
return env->ThrowUVException(err, "fchown");

joyeecheung Oct 6, 2023
edited
Loading

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

This does not need a new binding, it can just be done by switching SyncCall to SyncCallAndThrowOnError in the original FChownSync implementation.

aduh95 commented May 11, 2024

Copy link
Copy Markdown
Contributor

This needs a rebase.

evelez7 closed this by deleting the head repository Apr 22, 2025
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

c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. performance Issues and PRs related to the performance of Node.js.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL