src: speed up process.getActiveResourcesInfo()#46014
Merged
nodejs-github-bot merged 3 commits intonodejs:mainfrom Jan 3, 2023
Merged
src: speed up process.getActiveResourcesInfo()#46014nodejs-github-bot merged 3 commits intonodejs:mainfrom
process.getActiveResourcesInfo()#46014nodejs-github-bot merged 3 commits intonodejs:mainfrom
Conversation
This change reduces the number of calls that were crossing the JS-C++ boundary to 1 and also removes the need for calling Array::New() multiple times internally and ArrayPrototypeConcat-ing the results later on, thus improving performance. Refs: nodejs#44445 (review) Signed-off-by: Darshan Sen <[email protected]>
Collaborator
|
Review requested:
|
Contributor
|
Benchmark CI: https://ci.nodejs.org/job/benchmark-node-micro-benchmarks/1280 |
Contributor
|
Benchmark CI(timers): https://ci.nodejs.org/job/benchmark-node-micro-benchmarks/1281 Results |
aduh95
approved these changes
Dec 29, 2022
This comment was marked as outdated.
This comment was marked as outdated.
10 tasks
This comment was marked as outdated.
This comment was marked as outdated.
This was referenced Dec 31, 2022
anonrig
reviewed
Jan 1, 2023
| void GetActiveHandlesInfo(const FunctionCallbackInfo<Value>& args) { | ||
| static void GetActiveResourcesInfo(const FunctionCallbackInfo<Value>& args) { | ||
| Environment* env = Environment::GetCurrent(args); | ||
| std::vector<Local<Value>> resources_info; |
Member
There was a problem hiding this comment.
I wonder if you can omit using std::vector for better performance in here.
Member
Author
There was a problem hiding this comment.
Any suggestions on how you think that can be done?
22 tasks
Refs: nodejs#46014 (comment) Signed-off-by: Darshan Sen <[email protected]>
legendecas
approved these changes
Jan 2, 2023
aduh95
reviewed
Jan 2, 2023
Co-authored-by: Antoine du Hamel <[email protected]>
23 tasks
This comment was marked as outdated.
This comment was marked as outdated.
Collaborator
Collaborator
Commit Queue failed- Loading data for nodejs/node/pull/46014 ✔ Done loading data for nodejs/node/pull/46014 ----------------------------------- PR info ------------------------------------ Title src: speed up `process.getActiveResourcesInfo()` (#46014) Author Darshan Sen (@RaisinTen) Branch RaisinTen:src/speed-up-process.getActiveResourcesInfo -> nodejs:main Labels c++, lib / src, author ready, needs-ci, commit-queue-squash Commits 3 - src: speed up process.getActiveResourcesInfo() - lib: explain timeoutInfo - lib: update comment Committers 2 - Darshan Sen - GitHub PR-URL: https://github.com/nodejs/node/pull/46014 Reviewed-By: Antoine du Hamel Reviewed-By: Chengzhong Wu ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/46014 Reviewed-By: Antoine du Hamel Reviewed-By: Chengzhong Wu -------------------------------------------------------------------------------- ⚠ Commits were pushed since the last review: ⚠ - lib: update comment ℹ This PR was created on Thu, 29 Dec 2022 14:11:08 GMT ✔ Approvals: 2 ✔ - Antoine du Hamel (@aduh95) (TSC): https://github.com/nodejs/node/pull/46014#pullrequestreview-1232745904 ✔ - Chengzhong Wu (@legendecas) (TSC): https://github.com/nodejs/node/pull/46014#pullrequestreview-1233540022 ✔ Last GitHub CI successful ℹ Last Benchmark CI on 2022-12-29T20:19:51Z: https://ci.nodejs.org/job/benchmark-node-micro-benchmarks/1281 ℹ Last Full PR CI on 2023-01-03T08:15:41Z: https://ci.nodejs.org/job/node-test-pull-request/48821/ - Querying data for job/node-test-pull-request/48821/ ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ Aborted `git node land` session in /home/runner/work/node/node/.ncuhttps://github.com/nodejs/node/actions/runs/3828266911 |
legendecas
approved these changes
Jan 3, 2023
Collaborator
|
Landed in e35e893 |
This was referenced Jan 4, 2023
RafaelGSS
pushed a commit
to RafaelGSS/node
that referenced
this pull request
Jan 17, 2023
This change reduces the number of calls that were crossing the JS-C++ boundary to 1 and also removes the need for calling Array::New() multiple times internally and ArrayPrototypeConcat-ing the results later on, thus improving performance. Refs: nodejs#44445 (review) Signed-off-by: Darshan Sen <[email protected]> PR-URL: nodejs#46014 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]>
RafaelGSS
pushed a commit
that referenced
this pull request
Jan 20, 2023
This change reduces the number of calls that were crossing the JS-C++ boundary to 1 and also removes the need for calling Array::New() multiple times internally and ArrayPrototypeConcat-ing the results later on, thus improving performance. Refs: #44445 (review) Signed-off-by: Darshan Sen <[email protected]> PR-URL: #46014 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]>
Merged
juanarbol
pushed a commit
that referenced
this pull request
Jan 26, 2023
This change reduces the number of calls that were crossing the JS-C++ boundary to 1 and also removes the need for calling Array::New() multiple times internally and ArrayPrototypeConcat-ing the results later on, thus improving performance. Refs: #44445 (review) Signed-off-by: Darshan Sen <[email protected]> PR-URL: #46014 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]>
Merged
juanarbol
pushed a commit
that referenced
this pull request
Jan 31, 2023
This change reduces the number of calls that were crossing the JS-C++ boundary to 1 and also removes the need for calling Array::New() multiple times internally and ArrayPrototypeConcat-ing the results later on, thus improving performance. Refs: #44445 (review) Signed-off-by: Darshan Sen <[email protected]> PR-URL: #46014 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change reduces the number of calls that were crossing the JS-C++ boundary to 1 and also removes the need for calling
Array::New()multiple times internally andArrayPrototypeConcat-ing the results later on, thus improving performance by 75%!Refs: #44445 (review)
Signed-off-by: Darshan Sen [email protected]
process.getActiveResourcesInfo()benchmark result: 75% improvementtimersbenchmark result: no noticeable deterioration