Uh oh!
There was an error while loading. Please reload this page.
url: don't update URL immediately on update to URLSearchParams - #51520
Conversation
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. |
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: |
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 <duhamelantoine1995@gmail.com>
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 <duhamelantoine1995@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
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