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

perf_hooks: reduce overhead of new performance_entries #49803

Merged
merged 1 commit into from
Sep 27, 2023

Conversation

H4ad
Copy link
Member

@H4ad H4ad commented Sep 23, 2023

Continuing the work started on nodejs/performance#109

Removed two references for ReflectConstruct, the improvements for createPerformanceNodeEntry can be seen using the timerfied function:

                                                    confidence improvement accuracy (*)    (**)   (***)
perf_hooks/timerfied.js observe='function' n=100000        ***    872.44 %      ±22.56% ±30.40% ±40.36%

Be aware that when doing many comparisons the risk of a false-positive
result increases. In this case, there are 1 comparisons, you can thus
expect the following amount of false-positive results:
  0.05 false positives, when considering a   5% risk acceptance (*, **, ***),
  0.01 false positives, when considering a   1% risk acceptance (**, ***),
  0.00 false positives, when considering a 0.1% risk acceptance (***)

The createPerformanceEntry is not used, should I remove it?

/cc @nodejs/performance

@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Sep 23, 2023
@H4ad
Copy link
Member Author

H4ad commented Sep 23, 2023

@jasnell Do you have any reason to add ERR_ILLEGAL_CONSTRUCTOR for PerformanceEntry?

I saw the PerformanceMark without it, so maybe we could remove it from this class too, it will simplify this a lot this code.

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

@Uzlopak
Copy link
Contributor

Uzlopak commented Sep 23, 2023

impressive

Copy link
Member

@benjamingr benjamingr left a comment

Choose a reason for hiding this comment

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

oh wow we were passing a new constructor each time?

This is a subtly breaking change (if someone relied on them having different constructors) but I think we never made that commitment so this is fine to me as minor/patch

gj

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.

🚀

@H4ad
Copy link
Member Author

H4ad commented Sep 24, 2023

Sorry for the force-push but I read another PR of @rluvaton, this new way is a faster (793%->872%) and cleaner way to do the same thing.

Copy link
Member

@Qard Qard left a comment

Choose a reason for hiding this comment

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

LGTM. Out of curiosity though, with the skip throw thing in the constructor, can the perf be improved even further by putting the init behaviour directly in the constructor after the skipped throw?

@H4ad
Copy link
Member Author

H4ad commented Sep 25, 2023

@Qard, I need to try, but it may not change significantly as it will be essentially the same operations.

Also, I don't know if there is any spec compliance with the constructor I avoid changing the arguments of the Performance Entry, without = undefined, it breaks the webidl tests.

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

@H4ad
Copy link
Member Author

H4ad commented Sep 27, 2023

Is there something I can do about the failing checks?

@nodejs-github-bot
Copy link
Collaborator

@Uzlopak
Copy link
Contributor

Uzlopak commented Sep 27, 2023

@anonrig has to start them over and over again, till they are green :P

@anonrig anonrig added the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 27, 2023
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 27, 2023
@nodejs-github-bot nodejs-github-bot merged commit a6ad048 into nodejs:main Sep 27, 2023
30 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in a6ad048

@H4ad H4ad deleted the perf/perf_hooks branch September 27, 2023 01:52
ruyadorno pushed a commit that referenced this pull request Sep 28, 2023
PR-URL: #49803
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Stephen Belanger <[email protected]>
@ruyadorno ruyadorno mentioned this pull request Sep 28, 2023
ruyadorno pushed a commit that referenced this pull request Sep 28, 2023
PR-URL: #49803
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Stephen Belanger <[email protected]>
@ruyadorno ruyadorno mentioned this pull request Sep 28, 2023
alexfernandez pushed a commit to alexfernandez/node that referenced this pull request Nov 1, 2023
PR-URL: nodejs#49803
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Stephen Belanger <[email protected]>
debadree25 pushed a commit to debadree25/node that referenced this pull request Apr 15, 2024
PR-URL: nodejs#49803
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Stephen Belanger <[email protected]>
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. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants