http: improve performance of shouldUseProxy#59426
Open
Uzlopak wants to merge 2 commits intonodejs:mainfrom
Open
http: improve performance of shouldUseProxy#59426Uzlopak wants to merge 2 commits intonodejs:mainfrom
Uzlopak wants to merge 2 commits intonodejs:mainfrom
Conversation
Collaborator
|
Review requested:
|
ef99bf3 to
adacfa0
Compare
adacfa0 to
79f0534
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #59426 +/- ##
==========================================
- Coverage 89.91% 89.90% -0.01%
==========================================
Files 655 655
Lines 192866 192941 +75
Branches 37806 37833 +27
==========================================
+ Hits 173412 173467 +55
- Misses 12015 12021 +6
- Partials 7439 7453 +14
🚀 New features to boost your workflow:
|
joyeecheung
reviewed
Aug 10, 2025
| } | ||
|
|
||
| // See: https://about.gitlab.com/blog/we-need-to-talk-no-proxy | ||
| // TODO(joyeecheung): share code with undici. |
Member
There was a problem hiding this comment.
I would prefer this to happen before we do any optimisation. IMO it's better to put this in undici and we can vendor it in in Node.js. It's not ideal if fetch proxy decision starts to diverge from http/https built-ins as we keep making them more convoluted.
anonrig
approved these changes
Aug 22, 2025
jasnell
reviewed
Aug 23, 2025
| let octetShift = 0; | ||
| let code = 0; | ||
|
|
||
| for (let i = ip.length - 1; i >= 0; --i) { |
Member
There was a problem hiding this comment.
Nit: a comment in here briefly explaining the algorithm would be helpful for folks coming into this code later. Optional tho.
Contributor
|
This needs a rebase |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
*wroom* *wroom*
This PR improves the performance of shouldUseProxy.
Actually started 2 days ago with improving the perf of ipToInt...
Benchmarks on my machine:
Details
before:after: