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: apply getCallSite optimization #55174

Closed
wants to merge 4 commits into from

Conversation

RafaelGSS
Copy link
Member

Applying one of @jasnell suggestions #54380 (comment)

Result an possible performance boost of ~14%

➜  node (optimize-getcallsite) node-benchmark-compare compare.csv                                                         ✭ ✱
                                                            confidence improvement accuracy (*)   (**)  (***)
util/get-callsite.js method='CPP' n=100                            ***     14.00 %       ±3.69% ±4.92% ±6.43%

@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. util Issues and PRs related to the built-in util module. labels Sep 30, 2024
@RedYetiDev RedYetiDev added the needs-benchmark-ci PR that need a benchmark CI run. label Sep 30, 2024
@RafaelGSS
Copy link
Member Author

I believe the coverage errors are unrelated to this PR. Are we tracking it somewhere? @nodejs/build

@targos
Copy link
Member

targos commented Sep 30, 2024

It appeared with #53256. Unrelated to build WG activities.

src/node_util.cc Outdated Show resolved Hide resolved
src/node_util.cc Outdated
@@ -249,6 +250,7 @@ static void ParseEnv(const FunctionCallbackInfo<Value>& args) {
static void GetCallSite(const FunctionCallbackInfo<Value>& args) {
Environment* env = Environment::GetCurrent(args);
Isolate* isolate = env->isolate();
v8::HandleScope handle_scope(isolate);
Copy link
Member

Choose a reason for hiding this comment

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

Q for learning purposes: Why do we need a handle scope here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh this is no longer necessary. I was investigating a segmentation fault and though the variables were gcCollected before going back to JS.

@anonrig anonrig added the request-ci Add this label to start a Jenkins CI on a PR. label Sep 30, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 30, 2024
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Sep 30, 2024

@RafaelGSS
Copy link
Member Author

Is it ok if I go ahead and land this PR? Coverage should be solved on main, but rebasing would require a new CI run.

@RafaelGSS RafaelGSS added the commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. label Oct 2, 2024
RafaelGSS added a commit that referenced this pull request Oct 2, 2024
PR-URL: #55174
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
@RafaelGSS
Copy link
Member Author

Landed in 18536d9

@RafaelGSS RafaelGSS closed this Oct 2, 2024
targos pushed a commit that referenced this pull request Oct 4, 2024
PR-URL: #55174
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
targos pushed a commit that referenced this pull request Oct 4, 2024
PR-URL: #55174
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
@aduh95 aduh95 mentioned this pull request Oct 9, 2024
louwers pushed a commit to louwers/node that referenced this pull request Nov 2, 2024
PR-URL: nodejs#55174
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
@marco-ippolito marco-ippolito added the dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. label Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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. dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. needs-benchmark-ci PR that need a benchmark CI run. needs-ci PRs that need a full CI run. util Issues and PRs related to the built-in util module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants