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

src: implement v8 fast api for url canParse #47552

Merged
merged 6 commits into from
Apr 20, 2023

Conversation

KhafraDev
Copy link
Member

@KhafraDev KhafraDev commented Apr 13, 2023

This PR implements a fast api for url CanParse when only an input is provided. The benchmarks show massive improvements (https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1330/):

                                                        confidence improvement accuracy (*)   (**)   (***)
url/whatwg-url-canParse.js n=1000000 type='auth'              ***     17.58 %       ±3.12% ±4.16%  ±5.45%
url/whatwg-url-canParse.js n=1000000 type='dot'               ***     29.57 %       ±3.39% ±4.54%  ±5.97%
url/whatwg-url-canParse.js n=1000000 type='file'              ***     48.97 %       ±4.52% ±6.02%  ±7.87%
url/whatwg-url-canParse.js n=1000000 type='idn'                       -1.21 %       ±1.84% ±2.45%  ±3.19%
url/whatwg-url-canParse.js n=1000000 type='javascript'        ***     43.10 %       ±4.27% ±5.73%  ±7.56%
url/whatwg-url-canParse.js n=1000000 type='long'                       0.75 %       ±2.14% ±2.85%  ±3.71%
url/whatwg-url-canParse.js n=1000000 type='percent'           ***     20.03 %       ±2.20% ±2.93%  ±3.82%
url/whatwg-url-canParse.js n=1000000 type='short'             ***     43.81 %       ±6.36% ±8.50% ±11.15%
url/whatwg-url-canParse.js n=1000000 type='ws'                ***     33.83 %       ±2.79% ±3.72%  ±4.87%

Also this is my second c++ PR, please go easy on me. 😄

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/url

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. 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 Apr 13, 2023
Copy link
Member

@anonrig anonrig left a comment

Choose a reason for hiding this comment

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

Can you also add the tests?

src/node_url.cc Outdated Show resolved Hide resolved
src/node_url.cc Outdated Show resolved Hide resolved
@anonrig anonrig added whatwg-url Issues and PRs related to the WHATWG URL implementation. performance Issues and PRs related to the performance of Node.js. labels Apr 13, 2023
@anonrig anonrig added the commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. label Apr 13, 2023
@anonrig
Copy link
Member

anonrig commented Apr 13, 2023

@KhafraDev Can you also run a benchmark CI on this PR?

@anonrig anonrig added the needs-benchmark-ci PR that need a benchmark CI run. label Apr 13, 2023
@nodejs-github-bot

This comment was marked as duplicate.

@nodejs-github-bot
Copy link
Collaborator

@anonrig anonrig added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 14, 2023
@anonrig anonrig added the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 20, 2023
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 20, 2023
@nodejs-github-bot nodejs-github-bot merged commit 6675505 into nodejs:main Apr 20, 2023
@nodejs-github-bot
Copy link
Collaborator

Landed in 6675505

@KhafraDev KhafraDev deleted the canparse-fastapi branch April 20, 2023 16:57
targos pushed a commit that referenced this pull request May 2, 2023
PR-URL: #47552
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
@targos targos mentioned this pull request May 2, 2023
@danielleadams danielleadams added the backport-requested-v18.x PRs awaiting manual backport to the v18.x-staging branch. label Jun 27, 2023
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. backport-requested-v18.x PRs awaiting manual backport to the v18.x-staging branch. c++ Issues and PRs that require attention from people who are familiar with C++. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. lib / src Issues and PRs related to general changes in the lib or src directory. needs-benchmark-ci PR that need a benchmark CI run. needs-ci PRs that need a full CI run. performance Issues and PRs related to the performance of Node.js. whatwg-url Issues and PRs related to the WHATWG URL implementation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants