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: refactor debuglog init #38838

Merged
merged 1 commit into from
Jun 12, 2021
Merged

Conversation

aduh95
Copy link
Contributor

@aduh95 aduh95 commented May 29, 2021

Alternative to #38756.

@github-actions github-actions bot added needs-ci PRs that need a full CI run. util Issues and PRs related to the built-in util module. labels May 29, 2021
@aduh95
Copy link
Contributor Author

aduh95 commented May 29, 2021

Benchmark CI (misc/startup): https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1033/
Benchmark CI (streams+events): https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1034/

Results
                                                                                  confidence improvement accuracy (*)   (**)  (***)
misc/startup.js mode='process' script='benchmark/fixtures/require-builtins' dur=1                -0.57 %       ±1.70% ±2.26% ±2.94%
misc/startup.js mode='process' script='benchmark/fixtures/require-cachable' dur=1                 0.11 %       ±1.66% ±2.20% ±2.87%
misc/startup.js mode='process' script='test/fixtures/semicolon' dur=1                             0.31 %       ±0.97% ±1.30% ±1.69%
misc/startup.js mode='worker' script='benchmark/fixtures/require-builtins' dur=1                 -0.13 %       ±2.18% ±2.90% ±3.78%
misc/startup.js mode='worker' script='benchmark/fixtures/require-cachable' dur=1          **      3.04 %       ±1.97% ±2.62% ±3.42%
misc/startup.js mode='worker' script='test/fixtures/semicolon' dur=1                             -1.01 %       ±1.41% ±1.89% ±2.47%
                                                                                          confidence improvement accuracy (*)    (**)   (***)
events/ee-add-remove.js n=1000000 removeListener=0 newListener=0                                          1.40 %       ±4.75%  ±6.32%  ±8.24%
events/ee-add-remove.js n=1000000 removeListener=0 newListener=1                                         -0.77 %       ±3.29%  ±4.38%  ±5.70%
events/ee-add-remove.js n=1000000 removeListener=1 newListener=0                                         -1.87 %       ±4.08%  ±5.48%  ±7.24%
events/ee-add-remove.js n=1000000 removeListener=1 newListener=1                                         -0.70 %       ±3.61%  ±4.80%  ±6.25%
events/ee-emit.js listeners=10 argc=0 n=2000000                                                          -1.35 %       ±2.32%  ±3.11%  ±4.10%
events/ee-emit.js listeners=10 argc=10 n=2000000                                                         -0.46 %       ±1.03%  ±1.37%  ±1.79%
events/ee-emit.js listeners=10 argc=2 n=2000000                                                          -0.45 %       ±0.90%  ±1.20%  ±1.56%
events/ee-emit.js listeners=10 argc=4 n=2000000                                                           0.15 %       ±1.17%  ±1.56%  ±2.05%
events/ee-emit.js listeners=1 argc=0 n=2000000                                                            3.06 %       ±4.71%  ±6.27%  ±8.16%
events/ee-emit.js listeners=1 argc=10 n=2000000                                                          -1.68 %       ±4.12%  ±5.48%  ±7.13%
events/ee-emit.js listeners=1 argc=2 n=2000000                                                           -0.39 %       ±3.74%  ±4.98%  ±6.48%
events/ee-emit.js listeners=1 argc=4 n=2000000                                                           -1.30 %       ±4.12%  ±5.49%  ±7.15%
events/ee-emit.js listeners=5 argc=0 n=2000000                                                            1.13 %       ±2.36%  ±3.15%  ±4.10%
events/ee-emit.js listeners=5 argc=10 n=2000000                                                           0.55 %       ±1.88%  ±2.51%  ±3.28%
events/ee-emit.js listeners=5 argc=2 n=2000000                                                            0.33 %       ±2.32%  ±3.08%  ±4.02%
events/ee-emit.js listeners=5 argc=4 n=2000000                                                           -0.64 %       ±2.19%  ±2.92%  ±3.80%
events/ee-listener-count-on-prototype.js n=50000000                                                       0.13 %       ±2.05%  ±2.74%  ±3.57%
events/ee-listeners.js raw='false' listeners=50 n=5000000                                                -0.05 %       ±2.38%  ±3.18%  ±4.17%
events/ee-listeners.js raw='false' listeners=5 n=5000000                                                  0.32 %       ±1.94%  ±2.58%  ±3.36%
events/ee-listeners.js raw='true' listeners=50 n=5000000                                                 -1.22 %       ±1.32%  ±1.76%  ±2.30%
events/ee-listeners.js raw='true' listeners=5 n=5000000                                                  -1.59 %       ±5.51%  ±7.37%  ±9.67%
events/ee-once.js argc=0 n=20000000                                                                      -0.52 %       ±0.84%  ±1.12%  ±1.46%
events/ee-once.js argc=1 n=20000000                                                                       0.46 %       ±1.33%  ±1.77%  ±2.30%
events/ee-once.js argc=4 n=20000000                                                                      -1.96 %       ±3.15%  ±4.20%  ±5.49%
events/ee-once.js argc=5 n=20000000                                                               **     -2.06 %       ±1.42%  ±1.89%  ±2.47%
events/eventtarget.js listeners=10 n=1000000                                                              2.18 %       ±3.41%  ±4.56%  ±5.99%
events/eventtarget.js listeners=1 n=1000000                                                               3.68 %       ±4.56%  ±6.12%  ±8.05%
events/eventtarget.js listeners=5 n=1000000                                                               0.53 %       ±5.67%  ±7.55%  ±9.82%
streams/creation.js kind='duplex' n=50000000                                                       *      1.89 %       ±1.53%  ±2.03%  ±2.65%
streams/creation.js kind='readable' n=50000000                                                           -0.73 %       ±1.44%  ±1.91%  ±2.49%
streams/creation.js kind='transform' n=50000000                                                          -0.17 %       ±1.94%  ±2.58%  ±3.37%
streams/creation.js kind='writable' n=50000000                                                            0.56 %       ±1.09%  ±1.45%  ±1.89%
streams/pipe.js n=5000000                                                                                 0.48 %       ±4.31%  ±5.74%  ±7.47%
streams/pipe-object-mode.js n=5000000                                                                    -0.02 %       ±2.25%  ±2.99%  ±3.90%
streams/readable-async-iterator.js sync='no' n=100000                                                     0.61 %       ±2.31%  ±3.08%  ±4.01%
streams/readable-async-iterator.js sync='yes' n=100000                                                   -0.34 %       ±4.17%  ±5.55%  ±7.23%
streams/readable-bigread.js n=1000                                                                       -5.49 %       ±5.67%  ±7.55%  ±9.82%
streams/readable-bigunevenread.js n=1000                                                                  2.46 %       ±3.89%  ±5.17%  ±6.74%
streams/readable-boundaryread.js type='buffer' n=2000                                                     0.70 %       ±1.82%  ±2.42%  ±3.15%
streams/readable-boundaryread.js type='string' n=2000                                                     0.02 %       ±3.94%  ±5.24%  ±6.83%
streams/readable-from.js n=10000000                                                                       1.76 %       ±4.03%  ±5.37%  ±6.99%
streams/readable-readall.js n=5000                                                                        3.71 %       ±9.67% ±12.87% ±16.75%
streams/readable-unevenread.js n=1000                                                                     1.19 %       ±3.60%  ±4.79%  ±6.24%
streams/writable-manywrites.js len=1024 callback='no' writev='no' sync='no' n=2000000                     1.92 %       ±4.02%  ±5.41%  ±7.17%
streams/writable-manywrites.js len=1024 callback='no' writev='no' sync='yes' n=2000000                   -1.71 %       ±5.94%  ±7.93% ±10.38%
streams/writable-manywrites.js len=1024 callback='no' writev='yes' sync='no' n=2000000                   -0.14 %       ±2.53%  ±3.36%  ±4.38%
streams/writable-manywrites.js len=1024 callback='no' writev='yes' sync='yes' n=2000000                   0.97 %       ±3.03%  ±4.03%  ±5.24%
streams/writable-manywrites.js len=1024 callback='yes' writev='no' sync='no' n=2000000                   -0.46 %       ±1.23%  ±1.63%  ±2.13%
streams/writable-manywrites.js len=1024 callback='yes' writev='no' sync='yes' n=2000000                  -0.44 %       ±3.65%  ±4.86%  ±6.32%
streams/writable-manywrites.js len=1024 callback='yes' writev='yes' sync='no' n=2000000                   0.10 %       ±2.10%  ±2.80%  ±3.65%
streams/writable-manywrites.js len=1024 callback='yes' writev='yes' sync='yes' n=2000000                 -2.27 %       ±3.89%  ±5.18%  ±6.74%
streams/writable-manywrites.js len=32768 callback='no' writev='no' sync='no' n=2000000                   -0.44 %       ±2.08%  ±2.77%  ±3.62%
streams/writable-manywrites.js len=32768 callback='no' writev='no' sync='yes' n=2000000                  -0.88 %       ±1.26%  ±1.68%  ±2.18%
streams/writable-manywrites.js len=32768 callback='no' writev='yes' sync='no' n=2000000                   0.91 %       ±2.87%  ±3.83%  ±5.03%
streams/writable-manywrites.js len=32768 callback='no' writev='yes' sync='yes' n=2000000                 -1.70 %       ±3.51%  ±4.71%  ±6.20%
streams/writable-manywrites.js len=32768 callback='yes' writev='no' sync='no' n=2000000            *     -1.71 %       ±1.41%  ±1.88%  ±2.45%
streams/writable-manywrites.js len=32768 callback='yes' writev='no' sync='yes' n=2000000                 -0.41 %       ±1.11%  ±1.48%  ±1.93%
streams/writable-manywrites.js len=32768 callback='yes' writev='yes' sync='no' n=2000000                  0.70 %       ±1.77%  ±2.36%  ±3.09%
streams/writable-manywrites.js len=32768 callback='yes' writev='yes' sync='yes' n=2000000                -1.10 %       ±3.89%  ±5.22%  ±6.89%

@nodejs-github-bot
Copy link
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/38373/

@nodejs-github-bot
Copy link
Collaborator

@aduh95 aduh95 added the review wanted PRs that need reviews. label Jun 9, 2021
@nodejs-github-bot
Copy link
Collaborator

Copy link
Contributor

@RaisinTen RaisinTen left a comment

Choose a reason for hiding this comment

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

LGTM.
Would it also make sense to correct this comment nearby, by replacing debugs with debugImpls (it was supposed to be done in #33424)?

// `debugs` is deliberately initialized to undefined so any call to
// debuglog() before initializeDebugEnv() is called will throw.
let debugImpls;

@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Jun 9, 2021

@aduh95 aduh95 added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jun 11, 2021
PR-URL: nodejs#38838
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: Anto Aravinth <[email protected]>
@aduh95
Copy link
Contributor Author

aduh95 commented Jun 12, 2021

Landed in 423ae41

@aduh95 aduh95 merged commit 423ae41 into nodejs:master Jun 12, 2021
@aduh95 aduh95 deleted the refactor-debuglog-init branch June 12, 2021 16:56
danielleadams pushed a commit that referenced this pull request Jun 13, 2021
PR-URL: #38838
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: Anto Aravinth <[email protected]>
@danielleadams danielleadams mentioned this pull request Jun 14, 2021
danielleadams pushed a commit that referenced this pull request Jun 17, 2021
PR-URL: #38838
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: Anto Aravinth <[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. review wanted PRs that need reviews. util Issues and PRs related to the built-in util module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants