Skip to content

perf_hooks: reduce overhead of new resource timings - #49837

Merged
nodejs-github-bot merged 2 commits into
nodejs:mainfrom
H4ad:perf/perf_hooks_resource_timings
Sep 30, 2023
Merged

perf_hooks: reduce overhead of new resource timings#49837
nodejs-github-bot merged 2 commits into
nodejs:mainfrom
H4ad:perf/perf_hooks_resource_timings

Conversation

@H4ad

@H4adH4ad commented Sep 24, 2023

Copy link
Copy Markdown
Member

Continuing the work started on nodejs/performance#109.

This PR should be landed after #49803.

 confidence improvement accuracy (*) (**) (***)
perf_hooks/resourcetiming.js observe='resource' n=100000 *** 1086.23 % ±40.80% ±54.98% ±72.99%
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 (***)

I want to use the symbol kSkipThrow in other classes around the NodeJS codebase, someone had some idea where I should put it? Or create a new symbol and reuse it when possible?

Right now, we have this symbol being used on perf_hooks but there is also an identical symbol on webstreams, so maybe we can put it in a higher module and import it around the node, I initially thought to put it inside errors, since we will always use it together with ERR_ILLEGAL_CONSTRUCTOR.

I will reuse the same symbol only when it inherits some class that exports a symbol, otherwise, I will create a new one.

/cc @nodejs/performance

@nodejs-github-botnodejs-github-bot added the needs-ci PRs that need a full CI run. label Sep 24, 2023
@benjamingr

Copy link
Copy Markdown
Member

I want to use the symbol kSkipThrow in other classes around the NodeJS codebase, someone had some idea where I should put it? Or create a new symbol and reuse it when possible?

I would use a new symbol for each constructor so that if other parts in the code base need to create something in a way not exposed to userland they need to explicitly import it. We use this pattern in many other places like event_target too.

Comment threadlib/internal/perf/performance_entry.js Outdated
@H4ad
H4adforce-pushed the perf/perf_hooks_resource_timings branch from 42d7511 to cdcfc29CompareSeptember 28, 2023 00:09
@H4ad
H4ad marked this pull request as ready for review September 28, 2023 00:12
Comment threadlib/internal/perf/performance_entry.js Outdated
@anonriganonrig added performance Issues and PRs related to the performance of Node.js. 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 30, 2023
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 30, 2023
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@aduh95aduh95 added the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 30, 2023
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 30, 2023
@nodejs-github-bot
nodejs-github-bot merged commit e6e320e into nodejs:mainSep 30, 2023
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in e6e320e

@H4ad
H4ad deleted the perf/perf_hooks_resource_timings branch October 1, 2023 13:27
targos pushed a commit that referenced this pull request Nov 11, 2023
PR-URL: #49837
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
@targostargos mentioned this pull request Nov 12, 2023
debadree25 pushed a commit to debadree25/node that referenced this pull request Apr 15, 2024
PR-URL: nodejs#49837
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.needs-ciPRs that need a full CI run.performanceIssues and PRs related to the performance of Node.js.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@H4ad@benjamingr@nodejs-github-bot@Qard@anonrig@Uzlopak@aduh95