Visitar URL original
lib,src: replace toUSVString with `toWellFormed()` by anonrig · Pull Request #47342 · nodejs/node · GitHub
The Wayback Machine - https://web.archive.org/web/20230402092522/https://github.com/nodejs/node/pull/47342
Skip to content
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

lib,src: replace toUSVString with toWellFormed() #47342

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

anonrig
Copy link
Member

@anonrig anonrig commented Mar 31, 2023 •

We can't add ToWellFormed to primordials yet, because it's behind a harmony flag.

Fixes #47328, depends on V8 11.3

Benchmark CI: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1315/

Added notable-change label due to the doc-only deprecation of toUSVString

url/url-searchparams-creation.js n=1000000 inputType='iterable' type='array'                                           ***     13.84 %       ±2.92%  ±3.89%  ±5.06%
url/url-searchparams-creation.js n=1000000 inputType='iterable' type='encodelast'                                      ***     37.48 %       ±3.82%  ±5.10%  ±6.68%
url/url-searchparams-creation.js n=1000000 inputType='iterable' type='encodemany'                                      ***     40.92 %       ±3.38%  ±4.52%  ±5.93%
url/url-searchparams-creation.js n=1000000 inputType='iterable' type='multiprimitives'                                 ***     34.02 %       ±3.20%  ±4.26%  ±5.54%
url/url-searchparams-creation.js n=1000000 inputType='iterable' type='noencode'                                        ***     35.28 %       ±3.22%  ±4.28%  ±5.59%
url/url-searchparams-creation.js n=1000000 inputType='object' type='array'                                              **      5.75 %       ±3.45%  ±4.61%  ±6.05%
url/url-searchparams-creation.js n=1000000 inputType='object' type='encodelast'                                        ***     17.50 %       ±2.83%  ±3.77%  ±4.91%
url/url-searchparams-creation.js n=1000000 inputType='object' type='encodemany'                                        ***     16.51 %       ±3.34%  ±4.44%  ±5.78%
url/url-searchparams-creation.js n=1000000 inputType='object' type='multiprimitives'                                   ***     17.07 %       ±2.93%  ±3.90%  ±5.08%
url/url-searchparams-creation.js n=1000000 inputType='object' type='noencode'                                          ***     13.41 %       ±3.73%  ±4.99%  ±6.54%
url/url-searchparams-creation.js n=1000000 inputType='string' type='array'                                             ***      6.40 %       ±3.43%  ±4.57%  ±5.95%
url/url-searchparams-creation.js n=1000000 inputType='string' type='encodelast'                                        ***      7.34 %       ±3.07%  ±4.09%  ±5.32%
url/url-searchparams-creation.js n=1000000 inputType='string' type='encodemany'                                        ***      7.22 %       ±3.63%  ±4.83%  ±6.28%
url/url-searchparams-creation.js n=1000000 inputType='string' type='multiprimitives'                                   ***      8.62 %       ±3.06%  ±4.07%  ±5.30%
url/url-searchparams-creation.js n=1000000 inputType='string' type='noencode'                                          ***      7.33 %       ±3.08%  ±4.10%  ±5.34%
url/url-searchparams-iteration.js n=1000000 loopMethod='forEach'                                                               -2.47 %       ±6.73%  ±8.97% ±11.71%
url/url-searchparams-iteration.js n=1000000 loopMethod='iterator'                                                               0.13 %       ±3.97%  ±5.29%  ±6.88%
url/url-searchparams-read.js n=20000000 param='nonexistent' accessMethod='get'                                         ***     40.19 %       ±3.18%  ±4.25%  ±5.56%
url/url-searchparams-read.js n=20000000 param='nonexistent' accessMethod='getAll'                                      ***     49.89 %       ±3.43%  ±4.57%  ±5.97%
url/url-searchparams-read.js n=20000000 param='nonexistent' accessMethod='has'                                         ***     60.54 %       ±3.37%  ±4.51%  ±5.93%
url/url-searchparams-read.js n=20000000 param='one' accessMethod='get'                                                 ***     78.13 %       ±3.68%  ±4.93%  ±6.51%
url/url-searchparams-read.js n=20000000 param='one' accessMethod='getAll'                                              ***     23.62 %       ±2.74%  ±3.64%  ±4.74%
url/url-searchparams-read.js n=20000000 param='one' accessMethod='has'                                                 ***     84.82 %       ±4.26%  ±5.71%  ±7.50%
url/url-searchparams-read.js n=20000000 param='three' accessMethod='get'                                               ***     72.78 %       ±4.67%  ±6.21%  ±8.08%
url/url-searchparams-read.js n=20000000 param='three' accessMethod='getAll'                                            ***     25.17 %       ±2.42%  ±3.23%  ±4.23%
url/url-searchparams-read.js n=20000000 param='three' accessMethod='has'                                               ***     70.79 %       ±4.05%  ±5.43%  ±7.16%
url/url-searchparams-read.js n=20000000 param='two' accessMethod='get'                                                 ***     65.16 %       ±4.96%  ±6.61%  ±8.63%
url/url-searchparams-read.js n=20000000 param='two' accessMethod='getAll'                                              ***     26.08 %       ±3.88%  ±5.22%  ±6.89%
url/url-searchparams-read.js n=20000000 param='two' accessMethod='has'                                                 ***     60.99 %       ±2.14%  ±2.85%  ±3.72%

@anonrig anonrig added dont-land-on-v14.x PRs that should not land on the v14.x-staging branch and should not be released in v14.x. dont-land-on-v16.x PRs that should not land on the v16.x-staging branch and should not be released in v16.x. dont-land-on-v18.x PRs that should not land on the v18.x-staging branch and should not be released in v18.x. dont-land-on-v19.x PRs that should not land on the v19.x-staging branch and should not be released in v19.x. labels Mar 31, 2023
@nodejs-github-bot
Copy link
Contributor

Review requested:

  • @nodejs/url

@nodejs-github-bot nodejs-github-bot added lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Mar 31, 2023
@anonrig anonrig force-pushed the to-usv-string-to-well-formed branch 5 times, most recently from cd7df60 to 80a3312 Compare March 31, 2023 14:57
@anonrig anonrig added semver-minor PRs that contain new features and should be released in the next minor version. notable-change PRs with changes that should be highlighted in changelogs. labels Mar 31, 2023
@github-actions

This comment has been hidden.

@anonrig anonrig requested review from jasnell and mscdex March 31, 2023 18:44
@anonrig
Copy link
Member Author

anonrig commented Mar 31, 2023

Let's wait for #47340 to land to re-run the benchmark.

@anonrig
Copy link
Member Author

anonrig commented Apr 1, 2023 •

@anonrig anonrig force-pushed the to-usv-string-to-well-formed branch from b8411ac to 357ef37 Compare April 1, 2023 16:26
@anonrig anonrig added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. review wanted PRs that need reviews. labels Apr 1, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 1, 2023
@nodejs-github-bot
Copy link
Contributor

@anonrig anonrig requested review from mcollina and targos April 1, 2023 21:43
@nodejs-github-bot
Copy link
Contributor

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm


[`util.toUSVString()`][] is replaced with [`String.prototype.toWellFormed`][]
after V8 11.3. It is recommended to use the built-in function for performance
reasons.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should mention that now it is just an alias.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. dont-land-on-v14.x PRs that should not land on the v14.x-staging branch and should not be released in v14.x. dont-land-on-v16.x PRs that should not land on the v16.x-staging branch and should not be released in v16.x. dont-land-on-v18.x PRs that should not land on the v18.x-staging branch and should not be released in v18.x. dont-land-on-v19.x PRs that should not land on the v19.x-staging branch and should not be released in v19.x. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. notable-change PRs with changes that should be highlighted in changelogs. review wanted PRs that need reviews. semver-minor PRs that contain new features and should be released in the next minor version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

large performance regressions since f51c152
4 participants