-
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
url: refactor pathToFileURL
to native
#55476
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.42% 88.41% -0.01%
==========================================
Files 654 654
Lines 187662 187640 -22
Branches 36118 36121 +3
==========================================
- Hits 165945 165909 -36
- Misses 14955 14958 +3
- Partials 6762 6773 +11
|
Benchmark CI: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1647/ Results
|
This comment was marked as resolved.
This comment was marked as resolved.
b6c912b
to
7c53346
Compare
Benchmark CI: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1650/ Results
|
Benchmark CI: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1651/ Results
|
I find it puzzling that this PR shows a slow down on some seemingly unrelated benchmarks, however I think it's well worth the tradeoff given the overall perf improvements. Anyway, it's ready for reviews |
Landed in e2bd64d |
PR-URL: #55476 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
PR-URL: nodejs#55476 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
As suggested in #54545 (comment), let's see if it's faster.