GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — url: speed up WHATWG URL parsing by anonrig · Pull Request #65361 · nodejs/node Conversation
|
| Config | Before (ops/s) | After (ops/s) | Change |
|---|---|---|---|
short / no base |
7.82M | 9.29M | +19% |
long / no base |
2.50M | 2.75M | +10% |
short / with base |
2.94M | 3.39M | +15% |
dot (needs path normalization, so a new href string) is unchanged.
reuse_input defaults to nullptr. Base-URL parse and update() omit it so we skip the O(n) href == input compare when the original V8 string will not be reused.test/parallel/test-whatwg-url-*.js and test-url-*.js: 54 pass, 1 skipurl: 5107 pass, 0 unexpected failurestest/parallel/test-whatwg-url-parse-fast-path.js covers already-serialized ASCII hrefs, trailing-slash and dot-segment normalization, base resolution, non-string input, invalid input, unpaired surrogates, IDN, and settersAssisted-by: Cursor
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Review requested:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@ ## main #65361 +/- ## ========================================== - Coverage 91.85% 90.11% -1.74% ========================================== Files 400 752 +352 Lines 178855 252356 +73501 Branches 27319 47474 +20155 ========================================== + Hits 164283 227413 +63130 - Misses 14243 16224 +1981 - Partials 329 8719 +8390
🚀 New features to boost your workflow:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
AI agents are not permitted to Signed-off-by
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Sorry, something went wrong.
There was an error while loading. Please reload this page.
b9884e1 to
a66b5bc
Compare
|
Removed the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
a66b5bc to
39c4db7
Compare
Parse one-byte ASCII inputs in place instead of copying them into a UTF-8 buffer, and reuse the original V8 string when the serialized href is unchanged. Delay URLContext allocation until parse finishes and skip ToString when the input is already a string. Signed-off-by: Yagiz Nizipli <[email protected]> Assisted-by: Cursor
fa5ca3f to
ed31ad0
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I think we can avoid always comparing the strings here?
Base parsing and setters discard reuse_input, so here we can avoid an O(n) comparison no?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
ed31ad0 to
47af16c
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I think we can seperate PR same improvement for canParse?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
faad7a6 to
caa85b0
Compare
Callers that never reuse the original V8 string (base URL parse and setters) now omit reuse_input so ParseUrlFromV8String does not compare href against the input. Signed-off-by: Yagiz Nizipli <[email protected]> Assisted-by: Cursor
caa85b0 to
7589246
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Landed in 2df4ce7...a8f9a7f |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Parse one-byte ASCII inputs in place instead of copying them into a UTF-8 buffer, and reuse the original V8 string when the serialized href is unchanged. Delay URLContext allocation until parse finishes and skip ToString when the input is already a string. Signed-off-by: Yagiz Nizipli <[email protected]> Assisted-by: Cursor PR-URL: #65361 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Daniel Lemire <[email protected]> Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Callers that never reuse the original V8 string (base URL parse and setters) now omit reuse_input so ParseUrlFromV8String does not compare href against the input. Signed-off-by: Yagiz Nizipli <[email protected]> Assisted-by: Cursor PR-URL: #65361 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Daniel Lemire <[email protected]> Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Parse one-byte ASCII inputs in place instead of copying them into a UTF-8 buffer, and reuse the original V8 string when the serialized href is unchanged. Delay URLContext allocation until parse finishes and skip ToString when the input is already a string. Signed-off-by: Yagiz Nizipli <[email protected]> Assisted-by: Cursor PR-URL: #65361 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Daniel Lemire <[email protected]> Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Callers that never reuse the original V8 string (base URL parse and setters) now omit reuse_input so ParseUrlFromV8String does not compare href against the input. Signed-off-by: Yagiz Nizipli <[email protected]> Assisted-by: Cursor PR-URL: #65361 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Daniel Lemire <[email protected]> Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Parse one-byte ASCII inputs in place instead of copying them into a UTF-8 buffer, and reuse the original V8 string when the serialized href is unchanged. Delay URLContext allocation until parse finishes and skip ToString when the input is already a string. Signed-off-by: Yagiz Nizipli <[email protected]> Assisted-by: Cursor PR-URL: #65361 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Daniel Lemire <[email protected]> Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Callers that never reuse the original V8 string (base URL parse and setters) now omit reuse_input so ParseUrlFromV8String does not compare href against the input. Signed-off-by: Yagiz Nizipli <[email protected]> Assisted-by: Cursor PR-URL: #65361 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Daniel Lemire <[email protected]> Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Parse one-byte ASCII inputs in place instead of copying them into a UTF-8 buffer, and reuse the original V8 string when the serialized href is unchanged. Delay URLContext allocation until parse finishes and skip ToString when the input is already a string. Signed-off-by: Yagiz Nizipli <[email protected]> Assisted-by: Cursor PR-URL: #65361 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Daniel Lemire <[email protected]> Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Callers that never reuse the original V8 string (base URL parse and setters) now omit reuse_input so ParseUrlFromV8String does not compare href against the input. Signed-off-by: Yagiz Nizipli <[email protected]> Assisted-by: Cursor PR-URL: #65361 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Daniel Lemire <[email protected]> Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Parse one-byte ASCII inputs in place instead of copying them into a UTF-8 buffer, and reuse the original V8 string when the serialized href is unchanged. Delay URLContext allocation until parse finishes and skip ToString when the input is already a string. Signed-off-by: Yagiz Nizipli <[email protected]> Assisted-by: Cursor PR-URL: #65361 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Daniel Lemire <[email protected]> Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Callers that never reuse the original V8 string (base URL parse and setters) now omit reuse_input so ParseUrlFromV8String does not compare href against the input. Signed-off-by: Yagiz Nizipli <[email protected]> Assisted-by: Cursor PR-URL: #65361 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Daniel Lemire <[email protected]> Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Parse one-byte ASCII inputs in place instead of copying them into a UTF-8 buffer, and reuse the original V8 string when the serialized href is unchanged. Delay URLContext allocation until parse finishes and skip ToString when the input is already a string. Signed-off-by: Yagiz Nizipli <[email protected]> Assisted-by: Cursor PR-URL: #65361 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Daniel Lemire <[email protected]> Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Callers that never reuse the original V8 string (base URL parse and setters) now omit reuse_input so ParseUrlFromV8String does not compare href against the input. Signed-off-by: Yagiz Nizipli <[email protected]> Assisted-by: Cursor PR-URL: #65361 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Daniel Lemire <[email protected]> Reviewed-By: Gürgün Dayıoğlu <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.