Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.3k
url: don't update URL immediately on update to URLSearchParams#51520
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: don't update URL immediately on update to URLSearchParams #51520
Uh oh!
There was an error while loading. Please reload this page.
Conversation
MattIPv4 commented Jan 19, 2024 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
nodejs-github-bot commented Jan 19, 2024
Review requested:
|
This comment was marked as resolved.
This comment was marked as resolved.
Uh oh!
There was an error while loading. Please reload this page.
This appears to keep the "calling stringifier with this ={} didn't throw TypeError" test happyMattIPv4 commented Jan 19, 2024
|
anonrig commented Jan 19, 2024
WPT tests can't be changed. I recommend changing them on upstream if you think there is a bug. |
MattIPv4 commented Jan 19, 2024
Ah, hm. That might explain why this is implemented the rather inefficient way it is currently then, as |
MattIPv4 commented Jan 19, 2024
I've asked in the WPT Matrix as to why those tests expect the encoding to behave the way it does, but I believe this push should achieve the same performance benefit while only switching to URLSearchParams once they've actively been updated. |
MattIPv4 commented Jan 19, 2024 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Added a little benchmark, very open to suggestions on if there is a better way to do that. It seems to show a marked improvement with this fix though: |
MattIPv4 commented Jan 19, 2024 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Also, included a benchmark to check that the added logic in |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Antoine du Hamel <[email protected]>
nodejs-github-bot commented Jan 24, 2024
Landed in 925a464 |
MattIPv4 commented Jan 24, 2024
Should I have squashed the commits here before they were merged? I notice the commit into main uses the commit message of the first commit here, rather than the PR title, which results in what is now a bit of a misleading commit message? |
aduh95 commented Jan 24, 2024
Yeah the CQ when used with commit-queue-squash |
MattIPv4 commented Jan 24, 2024
Ah okay, TIL! Is the not-particularly-accurate commit message in main worth worrying about (might be confusing, esp. for the changelogs etc.)? |
aduh95 commented Jan 24, 2024
It's unfortunate, but we're way passed the 10 minute window, so the commit will stay as is. It might be worth opening a PR backporting it to 21.x-staging branch with the correct commit message (since that's the commits on that branch that actually end up on the changelog). node/doc/contributing/collaborator-guide.md Lines 775 to 777 in 62fc950
|
MattIPv4 commented Jan 24, 2024
Ack, no worries. I'll look at getting a backport up for 21.x (and ideally 20.x as well). |
MattIPv4 commented Jan 24, 2024
Would someone be able to add the backport open label for 21.x here, please? ❤️ |
aduh95 commented Jan 24, 2024
It might not be necessary, IIRC releasers will cherry-pick all the commits from the |
PR-URL: nodejs#51520Fixes: nodejs#51518 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
PR-URL: nodejs#51520Fixes: nodejs#51518 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
PR-URL: #51520Fixes: #51518 Backport-PR-URL: #51559 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
PR-URL: nodejs#51520Fixes: nodejs#51518 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
PR-URL: #51520Fixes: #51518 Backport-PR-URL: #51559 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
PR-URL: #51520Fixes: #51518 Backport-PR-URL: #51559 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
MattIPv4 commented Mar 26, 2024
Filed some issues w/ browsers etc. for the same performance issue, as this fix seems to have worked for Node.js w/o issue (knock on wood): |
This removes the performance impact caused by updating
URLwhen interacting withURL.searchParams, moving that cost to the first access ofURL.search,URL.href,URL.toString(), orURL.toJSON(), or to the first update of any part of theURL.Fixes: #51518