GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||
GeezerVison is showing github.com — fs: improve `ExistsSync` performance on Windows by anonrig · Pull Request #53537 · nodejs/node Conversation
Member
Simplifies code by using The following benchmark shows 2% improvement, but I'm sure if we had a Windows benchmark-ci machine it would have better results. Especially for symlinks, we are now not executing 2 different operating-system calls, and only one. FYI: std::filesystem::exists follows symlinks. Benchmark code: Benchmark result: cc @nodejs/fs @nodejs/platform-windows
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
anonrig
force-pushed
the
improve-existssync
branch
from
21d2b35 to
e2b3156
Compare
joyeecheung
reviewed
|
I agree. Unfortunately, I couldn't figure out some weird |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
05866e2 to
a7722d0
Compare
|
I've opened an issue to keep track of the Windows issue I'm facing: #53538 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I agree with @joyeecheung that this should be benchmarked properly before being merged. (Then again, benchmarking read-only fs operations is mostly pointless since the kernel will cache all the I/O and the results will not reflect real-world performance gains.)
Especially for symlinks, we are now not executing 2 different operating-system calls, and only one.
Did you test this hypothesis, or is it guaranteed by std::filesystem::exists?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Why would you need npm access to run the benchmarks? I think they can simply be run as ? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Oh I see in #53538 you were trying to run (Or you could run the R version with |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Microbenchmark CI https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1571/ |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
It seems, this PR is 15% faster |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
That only applies to the non-existing part. The question for me is what is more likely: existing or non-existing? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
a7722d0 to
a4b05d2
Compare
@BridgeAR for unix, the difference is 15% but on Windows, but on windows, it reduces the number of OS calls. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I was referencing the cppreference (https://en.cppreference.com/w/cpp/filesystem/exists) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I don't see anything in that reference that would guarantee that the standard library function makes a single system call (or the Windows equivalent) and not multiple system calls. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
a4b05d2 to
5c504b8
Compare
5c504b8 to
0c05f7c
Compare
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.