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

lib: use Promise.withResolvers() in timers #55720

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

anonrig
Copy link
Member

@anonrig anonrig commented Nov 4, 2024

Let's use Promise.withResolvers() instead of creating a promise directly.

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

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. timers Issues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout. labels Nov 4, 2024
@targos targos added dont-land-on-v18.x PRs that should not land on the v18.x-staging branch and should not be released in v18.x. dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. labels Nov 4, 2024
@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 Nov 4, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Nov 4, 2024
@nodejs-github-bot
Copy link
Collaborator

@RedYetiDev
Copy link
Member

                                               confidence improvement accuracy (*)   (**)  (***)
timers/immediate.js type='breadth' n=5000000                   0.58 %       ±1.42% ±1.89% ±2.47%
timers/immediate.js type='breadth1' n=5000000                  0.44 %       ±1.21% ±1.60% ±2.09%
timers/immediate.js type='breadth4' n=5000000                  0.38 %       ±0.88% ±1.18% ±1.55%
timers/immediate.js type='clear' n=5000000                    -0.15 %       ±1.69% ±2.25% ±2.92%
timers/immediate.js type='depth' n=5000000                     0.22 %       ±0.72% ±0.96% ±1.24%
timers/immediate.js type='depth1' n=5000000                    0.18 %       ±0.47% ±0.62% ±0.81%
timers/set-immediate-breadth-args.js n=5000000                -1.40 %       ±2.61% ±3.47% ±4.52%
timers/set-immediate-breadth.js n=10000000                     0.42 %       ±0.97% ±1.29% ±1.68%
timers/set-immediate-depth-args.js n=5000000                   1.06 %       ±1.28% ±1.71% ±2.23%

Copy link

codecov bot commented Nov 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.40%. Comparing base (bdc2662) to head (9498bc7).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #55720      +/-   ##
==========================================
+ Coverage   88.38%   88.40%   +0.02%     
==========================================
  Files         654      654              
  Lines      187575   187654      +79     
  Branches    36096    36110      +14     
==========================================
+ Hits       165795   165903     +108     
+ Misses      15004    14994      -10     
+ Partials     6776     6757      -19     
Files with missing lines Coverage Δ
lib/timers/promises.js 99.15% <100.00%> (-0.01%) ⬇️

... and 34 files with indirect coverage changes

@anonrig anonrig added the commit-queue Add this label to land a pull request using GitHub Actions. label Nov 4, 2024
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. commit-queue Add this label to land a pull request using GitHub Actions. dont-land-on-v18.x PRs that should not land on the v18.x-staging branch and should not be released in v18.x. 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-ci PRs that need a full CI run. timers Issues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants