-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
url: don't update URL immediately on update to URLSearchParams #51520
Conversation
Review requested:
|
This comment was marked as resolved.
This comment was marked as resolved.
3c5cb28
to
aadda98
Compare
This appears to keep the "calling stringifier with this = {} didn't throw TypeError" test happy
2d6f0e5
to
b0270bc
Compare
|
WPT tests can't be changed. I recommend changing them on upstream if you think there is a bug. |
Ah, hm. That might explain why this is implemented the rather inefficient way it is currently then, as |
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:
|
863ab4d
to
8c0a218
Compare
Also, included a benchmark to check that the added logic in
|
c69208c
to
6876ecc
Compare
Landed in 925a464 |
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? |
Yeah the CQ when used with
commit-queue-squash
|
Ah okay, TIL! Is the not-particularly-accurate commit message in main worth worrying about (might be confusing, esp. for the changelogs etc.)? |
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
|
Ack, no worries. I'll look at getting a backport up for 21.x (and ideally 20.x as well). |
PR-URL: nodejs#51520 Fixes: nodejs#51518 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
PR-URL: nodejs#51520 Fixes: nodejs#51518 Backport-PR-URL: nodejs#51559 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Would someone be able to add the backport open label for 21.x here, please? ❤️ |
It might not be necessary, IIRC releasers will cherry-pick all the commits from the |
PR-URL: nodejs#51520 Fixes: nodejs#51518 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
PR-URL: nodejs#51520 Fixes: nodejs#51518 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
PR-URL: #51520 Fixes: #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#51520 Fixes: nodejs#51518 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
PR-URL: #51520 Fixes: #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: #51520 Fixes: #51518 Backport-PR-URL: #51559 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
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
URL
when 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