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: add ability to overload fast api functions #48993

Closed
wants to merge 2 commits into from

Conversation

anonrig
Copy link
Member

@anonrig anonrig commented Aug 1, 2023

Uses v8 fast api overloads to define canParse method, and remove duplicated external symbols.

cc @nodejs/url @nodejs/performance

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. labels Aug 1, 2023
@anonrig anonrig marked this pull request as ready for review August 1, 2023 22:06
@anonrig anonrig added commit-queue-rebase Add this label to allow the Commit Queue to land a PR in several commits. dont-land-on-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. labels Aug 1, 2023
@anonrig anonrig force-pushed the add-fast-api-overloads branch from a0bdd05 to 12130bb Compare August 1, 2023 22:09
@devsnek
Copy link
Member

devsnek commented Aug 1, 2023

funny question to ask but could these functions be defined as overloads for SetFastMethod and SetFastMethodNoSideEffects?

lib/internal/url.js Outdated Show resolved Hide resolved
@anonrig
Copy link
Member Author

anonrig commented Aug 1, 2023

funny question to ask but could these functions be defined as overloads for SetFastMethod and SetFastMethodNoSideEffects?

haha, probably yes!

@anonrig anonrig added the needs-benchmark-ci PR that need a benchmark CI run. label Aug 1, 2023
src/node_url.cc Outdated Show resolved Hide resolved
@anonrig anonrig force-pushed the add-fast-api-overloads branch 2 times, most recently from 0457a0a to 4f9175c Compare August 6, 2023 15:27
@anonrig anonrig force-pushed the add-fast-api-overloads branch from 4f9175c to 7f918a9 Compare August 8, 2023 02:23
@anonrig anonrig requested review from joyeecheung and devsnek August 8, 2023 02:24
@anonrig anonrig added the review wanted PRs that need reviews. label Aug 8, 2023
Copy link
Member

@joyeecheung joyeecheung left a comment

Choose a reason for hiding this comment

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

LGTM, I'd suggest we run benchmark CI again before landing it (probably need to wait until the security embargo is lifted)

@anonrig
Copy link
Member Author

anonrig commented Aug 10, 2023

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

Results
                                                       confidence improvement accuracy (*)   (**)  (***)
url/whatwg-url-canParse.js n=1000000 type='auth'                       0.28 %       ±2.29% ±3.04% ±3.96%
url/whatwg-url-canParse.js n=1000000 type='dot'                       -2.09 %       ±2.94% ±3.91% ±5.09%
url/whatwg-url-canParse.js n=1000000 type='file'                       4.04 %       ±4.24% ±5.64% ±7.34%
url/whatwg-url-canParse.js n=1000000 type='idn'                        0.36 %       ±1.14% ±1.51% ±1.97%
url/whatwg-url-canParse.js n=1000000 type='javascript'                 0.81 %       ±2.85% ±3.80% ±4.94%
url/whatwg-url-canParse.js n=1000000 type='long'                       0.16 %       ±1.49% ±1.98% ±2.59%
url/whatwg-url-canParse.js n=1000000 type='percent'                   -2.28 %       ±2.36% ±3.14% ±4.09%
url/whatwg-url-canParse.js n=1000000 type='short'                     -2.96 %       ±4.90% ±6.53% ±8.51%
url/whatwg-url-canParse.js n=1000000 type='ws'                         1.84 %       ±3.60% ±4.80% ±6.25%

@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. labels Aug 10, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 10, 2023
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@anonrig anonrig added the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 12, 2023
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 12, 2023
@nodejs-github-bot
Copy link
Collaborator

Landed in 82e4ca1...607a545

nodejs-github-bot pushed a commit that referenced this pull request Aug 12, 2023
nodejs-github-bot pushed a commit that referenced this pull request Aug 12, 2023
Ceres6 pushed a commit to Ceres6/node that referenced this pull request Aug 14, 2023
Ceres6 pushed a commit to Ceres6/node that referenced this pull request Aug 14, 2023
RafaelGSS pushed a commit that referenced this pull request Aug 15, 2023
RafaelGSS pushed a commit that referenced this pull request Aug 15, 2023
@UlisesGascon UlisesGascon mentioned this pull request Aug 15, 2023
RafaelGSS pushed a commit to RafaelGSS/node that referenced this pull request Aug 15, 2023
RafaelGSS pushed a commit to RafaelGSS/node that referenced this pull request Aug 15, 2023
rluvaton pushed a commit to rluvaton/node that referenced this pull request Aug 15, 2023
rluvaton pushed a commit to rluvaton/node that referenced this pull request Aug 15, 2023
RafaelGSS pushed a commit that referenced this pull request Aug 16, 2023
RafaelGSS pushed a commit that referenced this pull request Aug 16, 2023
RafaelGSS pushed a commit that referenced this pull request Aug 17, 2023
RafaelGSS pushed a commit that referenced this pull request Aug 17, 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. c++ Issues and PRs that require attention from people who are familiar with C++. commit-queue-rebase Add this label to allow the Commit Queue to land a PR in several commits. dont-land-on-v18.x PRs that should not land on the v18.x-staging branch and should not be released in v18.x. needs-benchmark-ci PR that need a benchmark CI run. needs-ci PRs that need a full CI run. review wanted PRs that need reviews.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants