-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
fs: add c++ binding for readdirRecursiveSync #55722
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #55722 +/- ##
========================================
Coverage 88.39% 88.40%
========================================
Files 654 654
Lines 187560 187716 +156
Branches 36087 36127 +40
========================================
+ Hits 165800 165956 +156
- Misses 14996 14999 +3
+ Partials 6764 6761 -3
|
3dec768
to
1f7f80f
Compare
src/node_file.cc
Outdated
uv_fs_req_cleanup(&req_wrap_sync.req); | ||
} | ||
|
||
Local<Array> result_array = Array::New(isolate, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
creating an std::array, mutating them after the for loops below, and later assigning it to a Local might make the code more readable (and faster)
Can you create a new benchmark in https://github.com/nodejs/node/blob/main/benchmark/fs folder? |
1f7f80f
to
09ee178
Compare
09ee178
to
babf88f
Compare
I will add a benchmark later today |
20d06ca
to
d89cb3c
Compare
d89cb3c
to
3774a32
Compare
Creates a C++ binding for
readdirRecursiveSync
My first ever C++ PR, so please have mercy, I might be doing silly/unnecessary operations 😄
It lowers the JS-C++ jumps significantly, from however many paths to 1 for each call