-
Notifications
You must be signed in to change notification settings - Fork 29.5k
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
url: refactor pathToFileURL
to native
#55476
base: main
Are you sure you want to change the base?
Conversation
Review requested:
|
Benchmark CI: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1646/ Results
|
Amazing work. This will really improve the performance and make a huge impact. |
src/node_url.cc
Outdated
@@ -75,6 +75,73 @@ void BindingData::Deserialize(v8::Local<v8::Context> context, | |||
CHECK_NOT_NULL(binding); | |||
} | |||
|
|||
std::string EncodePathChars(const std::string& input_str, bool windows) { |
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.
Non-blocking nit: Really not a big fan of bool arguments to methods like this. Would prefer an enum.
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.
PS: If you use a template argument you can make isWindows checks a constexpr and eliminate the branch.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #55476 +/- ##
=======================================
Coverage 88.41% 88.41%
=======================================
Files 653 653
Lines 187497 187449 -48
Branches 36101 36087 -14
=======================================
- Hits 165767 165734 -33
+ Misses 14968 14951 -17
- Partials 6762 6764 +2
|
Benchmark CI: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1647/ Results
|
As suggested in #54545 (comment), let's see if it's faster.