Skip to content
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

win,fs: improve realpathSync performance #33941

Closed
wants to merge 1 commit into from

Conversation

bartbrzo
Copy link

@bartbrzo bartbrzo commented Jun 18, 2020

Moving knownHard object improves realpathSync perfomance.
This results in require being 10% faster on Windows and
realpathSync itself 50x faster.
Ref: #28946

..>cat results.csv | Rscript compare.R
                                                       confidence improvement accuracy (*)      (**)     (***)
 fs\\bench-realpath.js pathType='relative' n=10000                     0.79 %      A±2.99%   A±3.98%   A±5.19%
 fs\\bench-realpath.js pathType='resolved' n=10000              *      2.29 %      A±2.26%   A±3.00%   A±3.91%
 fs\\bench-realpathSync.js pathType='relative' n=10000        ***   5178.34 %     A±81.16% A±109.38% A±145.22%
 fs\\bench-realpathSync.js pathType='resolved' n=10000        ***   6179.63 %     A±72.30%  A±97.45% A±129.37%
  • make -j4 test (UNIX), or vcbuild test (Windows) passes

Moving knownHard object improves realpathSync perfomance.
This results in require being 10% faster on Windows and
realpathSync itself 50x faster.
Ref: nodejs#28946
@nodejs-github-bot nodejs-github-bot added the fs Issues and PRs related to the fs subsystem / file system. label Jun 18, 2020
@bzoz
Copy link
Contributor

bzoz commented Jun 18, 2020

1 similar comment
@nodejs-github-bot
Copy link
Collaborator

Copy link
Contributor

@mscdex mscdex left a comment

Choose a reason for hiding this comment

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

I don't think this is the correct solution to the performance problem as this will create a leak since knownHard is never reset in this PR.

@mscdex
Copy link
Contributor

mscdex commented Jun 18, 2020

Additionally hard links may disappear during the lifetime of the process, giving incorrect results if knownHard contains stale information.

@github-actions
Copy link
Contributor

This issue/PR was marked as stalled, it will be automatically closed in 30 days. If it should remain open, please leave a comment explaining why it should remain open.

@github-actions
Copy link
Contributor

Closing this because it has stalled. Feel free to reopen if this PR is still relevant, or to ping the collaborator who labelled it stalled if you have any questions.

@github-actions github-actions bot closed this Nov 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fs Issues and PRs related to the fs subsystem / file system. semver-major PRs that contain breaking changes and should be released in the next major version. stalled Issues and PRs that are stalled.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants