http: improve performance of shouldUseProxy - #59426
Conversation
|
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:
|
| } | ||
|
|
||
| // See: https://about.gitlab.com/blog/we-need-to-talk-no-proxy | ||
| // TODO(joyeecheung): share code with undici. |
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.
| let octetShift = 0; | ||
| let code = 0; | ||
|
|
||
| for (let i = ip.length - 1; i >= 0; --i) { |
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.
|
This needs a rebase |
|
This pull request has been marked as stale due to 90 days of inactivity. |
*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: