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

util: refactor to use more primordials #36265

Closed
wants to merge 2 commits into from

Conversation

aduh95
Copy link
Contributor

@aduh95 aduh95 commented Nov 25, 2020

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the lib / src Issues and PRs related to general changes in the lib or src directory. label Nov 25, 2020
@mscdex

This comment has been minimized.

@aduh95

This comment has been minimized.

@aduh95 aduh95 marked this pull request as ready for review December 21, 2020 16:46
@aduh95 aduh95 added the review wanted PRs that need reviews. label Dec 21, 2020
@aduh95
Copy link
Contributor Author

aduh95 commented Dec 22, 2020

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

                                                                                                confidence improvement accuracy (*)   (**)   (***)
 util/format.js type='many-%' n=100000                                                                          0.48 %       ±4.94% ±6.58%  ±8.58%
 util/format.js type='no-replace-2' n=100000                                                                    3.17 %       ±5.33% ±7.10%  ±9.25%
 util/format.js type='no-replace' n=100000                                                                      1.75 %       ±5.37% ±7.15%  ±9.32%
 util/format.js type='number' n=100000                                                                          1.37 %       ±5.89% ±7.84% ±10.21%
 util/format.js type='object-%s' n=100000                                                                       0.68 %       ±2.03% ±2.70%  ±3.52%
 util/format.js type='object-to-string' n=100000                                                               -1.62 %       ±3.17% ±4.22%  ±5.50%
 util/format.js type='only-objects' n=100000                                                                    0.24 %       ±2.63% ±3.50%  ±4.56%
 util/format.js type='replace-object' n=100000                                                                  3.74 %       ±4.69% ±6.25%  ±8.15%
 util/format.js type='string-2' n=100000                                                                       -0.11 %       ±3.80% ±5.05%  ±6.58%
 util/format.js type='string' n=100000                                                                          0.52 %       ±5.69% ±7.57%  ±9.85%
 util/format.js type='unknown' n=100000                                                                        -1.49 %       ±5.42% ±7.21%  ±9.39%
 util/inspect-array.js type='denseArray' len=100000 n=500                                                       0.06 %       ±3.65% ±4.86%  ±6.33%
 util/inspect-array.js type='denseArray' len=100 n=500                                                          2.51 %       ±5.48% ±7.29%  ±9.49%
 util/inspect-array.js type='denseArray_showHidden' len=100000 n=500                                           -0.09 %       ±4.71% ±6.26%  ±8.15%
 util/inspect-array.js type='denseArray_showHidden' len=100 n=500                                               2.51 %       ±4.65% ±6.20%  ±8.09%
 util/inspect-array.js type='mixedArray' len=100000 n=500                                                      -1.40 %       ±2.42% ±3.21%  ±4.19%
 util/inspect-array.js type='mixedArray' len=100 n=500                                                          4.47 %       ±4.73% ±6.30%  ±8.21%
 util/inspect-array.js type='sparseArray' len=100000 n=500                                                      3.18 %       ±4.19% ±5.58%  ±7.28%
 util/inspect-array.js type='sparseArray' len=100 n=500                                                         2.96 %       ±7.29% ±9.74% ±12.76%
 util/inspect.js option='colors' method='Array' n=20000                                                         0.19 %       ±2.56% ±3.42%  ±4.48%
 util/inspect.js option='colors' method='Date' n=20000                                                         -2.09 %       ±5.01% ±6.66%  ±8.67%
 util/inspect.js option='colors' method='Error' n=20000                                                        -0.88 %       ±3.48% ±4.63%  ±6.03%
 util/inspect.js option='colors' method='Number' n=20000                                                        1.14 %       ±4.66% ±6.21%  ±8.10%
 util/inspect.js option='colors' method='Object_deep_ln' n=20000                                               -1.01 %       ±2.19% ±2.92%  ±3.81%
 util/inspect.js option='colors' method='Object_empty' n=20000                                           *     -5.22 %       ±4.63% ±6.17%  ±8.03%
 util/inspect.js option='colors' method='Object' n=20000                                                       -0.24 %       ±4.88% ±6.52%  ±8.54%
 util/inspect.js option='colors' method='Set' n=20000                                                           1.06 %       ±4.13% ±5.50%  ±7.16%
 util/inspect.js option='colors' method='String_boxed' n=20000                                                 -1.18 %       ±4.57% ±6.08%  ±7.92%
 util/inspect.js option='colors' method='String_complex' n=20000                                               -1.03 %       ±3.61% ±4.81%  ±6.26%
 util/inspect.js option='colors' method='String' n=20000                                                       -2.91 %       ±4.93% ±6.58%  ±8.61%
 util/inspect.js option='colors' method='TypedArray_extra' n=20000                                             -1.28 %       ±1.82% ±2.42%  ±3.15%
 util/inspect.js option='colors' method='TypedArray' n=20000                                                    0.83 %       ±2.26% ±3.00%  ±3.91%
 util/inspect.js option='none' method='Array' n=20000                                                          -5.25 %       ±5.49% ±7.35%  ±9.67%
 util/inspect.js option='none' method='Date' n=20000                                                            0.36 %       ±5.17% ±6.88%  ±8.97%
 util/inspect.js option='none' method='Error' n=20000                                                          -2.56 %       ±4.97% ±6.62%  ±8.63%
 util/inspect.js option='none' method='Number' n=20000                                                          0.28 %       ±2.94% ±3.92%  ±5.10%
 util/inspect.js option='none' method='Object_deep_ln' n=20000                                                  0.53 %       ±2.02% ±2.70%  ±3.52%
 util/inspect.js option='none' method='Object_empty' n=20000                                             *     -5.11 %       ±4.14% ±5.52%  ±7.21%
 util/inspect.js option='none' method='Object' n=20000                                                          3.35 %       ±4.05% ±5.40%  ±7.05%
 util/inspect.js option='none' method='Set' n=20000                                                            -3.02 %       ±4.18% ±5.56%  ±7.24%
 util/inspect.js option='none' method='String_boxed' n=20000                                                   -3.31 %       ±5.09% ±6.78%  ±8.83%
 util/inspect.js option='none' method='String_complex' n=20000                                                 -4.09 %       ±4.68% ±6.23%  ±8.12%
 util/inspect.js option='none' method='String' n=20000                                                          2.32 %       ±4.58% ±6.10%  ±7.95%
 util/inspect.js option='none' method='TypedArray_extra' n=20000                                               -3.90 %       ±7.09% ±9.43% ±12.27%
 util/inspect.js option='none' method='TypedArray' n=20000                                                     -2.11 %       ±2.35% ±3.13%  ±4.10%
 util/inspect.js option='showHidden' method='Array' n=20000                                             **     -2.01 %       ±1.41% ±1.88%  ±2.45%
 util/inspect.js option='showHidden' method='Date' n=20000                                                      1.22 %       ±3.98% ±5.29%  ±6.89%
 util/inspect.js option='showHidden' method='Error' n=20000                                                    -0.95 %       ±4.15% ±5.53%  ±7.21%
 util/inspect.js option='showHidden' method='Number' n=20000                                                    0.53 %       ±3.62% ±4.83%  ±6.29%
 util/inspect.js option='showHidden' method='Object_deep_ln' n=20000                                           -1.12 %       ±2.72% ±3.62%  ±4.72%
 util/inspect.js option='showHidden' method='Object_empty' n=20000                                              3.98 %       ±4.90% ±6.54%  ±8.54%
 util/inspect.js option='showHidden' method='Object' n=20000                                                    1.79 %       ±4.38% ±5.83%  ±7.59%
 util/inspect.js option='showHidden' method='Set' n=20000                                                *     -4.85 %       ±4.14% ±5.52%  ±7.21%
 util/inspect.js option='showHidden' method='String_boxed' n=20000                                             -3.31 %       ±3.83% ±5.10%  ±6.64%
 util/inspect.js option='showHidden' method='String_complex' n=20000                                           -2.91 %       ±3.27% ±4.36%  ±5.68%
 util/inspect.js option='showHidden' method='String' n=20000                                                   -0.76 %       ±3.77% ±5.01%  ±6.52%
 util/inspect.js option='showHidden' method='TypedArray_extra' n=20000                                         -1.23 %       ±2.30% ±3.07%  ±4.01%
 util/inspect.js option='showHidden' method='TypedArray' n=20000                                                0.54 %       ±2.19% ±2.91%  ±3.79%
 util/inspect-proxy.js isProxy=0 showProxy=0 n=100000                                                           2.57 %       ±3.34% ±4.46%  ±5.81%
 util/inspect-proxy.js isProxy=0 showProxy=1 n=100000                                                          -1.14 %       ±1.91% ±2.54%  ±3.31%
 util/inspect-proxy.js isProxy=1 showProxy=0 n=100000                                                           0.52 %       ±1.92% ±2.56%  ±3.33%
 util/inspect-proxy.js isProxy=1 showProxy=1 n=100000                                                          -1.46 %       ±2.06% ±2.74%  ±3.57%
 util/normalize-encoding.js n=100000 input=''                                                                   2.05 %       ±7.18% ±9.58% ±12.51%
 util/normalize-encoding.js n=100000 input='base64'                                                            -3.27 %       ±5.32% ±7.10%  ±9.30%
 util/normalize-encoding.js n=100000 input='BASE64'                                                            -1.48 %       ±5.46% ±7.28%  ±9.53%
 util/normalize-encoding.js n=100000 input='binary'                                                             4.61 %       ±4.86% ±6.47%  ±8.42%
 util/normalize-encoding.js n=100000 input='BINARY'                                                             2.24 %       ±6.15% ±8.21% ±10.73%
 util/normalize-encoding.js n=100000 input='foo'                                                               -4.15 %       ±4.27% ±5.69%  ±7.43%
 util/normalize-encoding.js n=100000 input='group_common'                                                      -3.52 %       ±4.92% ±6.55%  ±8.56%
 util/normalize-encoding.js n=100000 input='group_misc'                                                        -3.44 %       ±4.67% ±6.22%  ±8.11%
 util/normalize-encoding.js n=100000 input='group_uncommon'                                                    -2.14 %       ±5.35% ±7.12%  ±9.26%
 util/normalize-encoding.js n=100000 input='group_upper'                                                       -1.88 %       ±5.71% ±7.62%  ±9.97%
 util/normalize-encoding.js n=100000 input='hex'                                                               -1.09 %       ±5.70% ±7.59%  ±9.87%
 util/normalize-encoding.js n=100000 input='HEX'                                                               -0.47 %       ±4.08% ±5.43%  ±7.07%
 util/normalize-encoding.js n=100000 input='latin1'                                                            -3.58 %       ±5.42% ±7.21%  ±9.40%
 util/normalize-encoding.js n=100000 input='ucs2'                                                              -3.94 %       ±6.13% ±8.18% ±10.69%
 util/normalize-encoding.js n=100000 input='UCS2'                                                              -0.09 %       ±4.25% ±5.66%  ±7.38%
 util/normalize-encoding.js n=100000 input='undefined'                                                          2.78 %       ±4.68% ±6.23%  ±8.11%
 util/normalize-encoding.js n=100000 input='utf16le'                                                            0.52 %       ±4.74% ±6.30%  ±8.20%
 util/normalize-encoding.js n=100000 input='UTF16LE'                                                           -1.67 %       ±5.34% ±7.11%  ±9.26%
 util/normalize-encoding.js n=100000 input='utf-8'                                                             -0.35 %       ±6.55% ±8.73% ±11.39%
 util/normalize-encoding.js n=100000 input='utf8'                                                               3.54 %       ±5.42% ±7.21%  ±9.38%
 util/normalize-encoding.js n=100000 input='Utf8'                                                               0.48 %       ±4.51% ±6.00%  ±7.82%
 util/normalize-encoding.js n=100000 input='UTF-8'                                                             -1.48 %       ±4.61% ±6.14%  ±7.99%
 util/normalize-encoding.js n=100000 input='UTF8'                                                              -0.99 %       ±4.56% ±6.07%  ±7.91%
 util/priority-queue.js n=100000                                                                               -0.80 %       ±5.62% ±7.48%  ±9.73%
 util/splice-one.js size=100 pos='end' n=100000                                                                -0.68 %       ±5.47% ±7.28%  ±9.49%
 util/splice-one.js size=100 pos='middle' n=100000                                                       *      5.57 %       ±4.93% ±6.56%  ±8.56%
 util/splice-one.js size=100 pos='start' n=100000                                                               0.26 %       ±3.21% ±4.28%  ±5.59%
 util/splice-one.js size=10 pos='end' n=100000                                                                  0.15 %       ±5.15% ±6.86%  ±8.93%
 util/splice-one.js size=10 pos='middle' n=100000                                                              -3.92 %       ±4.44% ±5.91%  ±7.70%
 util/splice-one.js size=10 pos='start' n=100000                                                                0.16 %       ±3.27% ±4.36%  ±5.68%
 util/splice-one.js size=500 pos='end' n=100000                                                                -4.44 %       ±5.62% ±7.48%  ±9.73%
 util/splice-one.js size=500 pos='middle' n=100000                                                       *      4.94 %       ±4.71% ±6.27%  ±8.17%
 util/splice-one.js size=500 pos='start' n=100000                                                              -0.07 %       ±2.54% ±3.39%  ±4.41%
 util/type-check.js n=100000 argument='false-object' version='js' type='ArrayBufferView'                        1.23 %       ±5.47% ±7.28%  ±9.47%
 util/type-check.js n=100000 argument='false-object' version='js' type='TypedArray'                             0.35 %       ±4.82% ±6.45%  ±8.48%
 util/type-check.js n=100000 argument='false-object' version='js' type='Uint8Array'                            -0.90 %       ±5.30% ±7.06%  ±9.21%
 util/type-check.js n=100000 argument='false-object' version='native' type='ArrayBufferView'                    4.86 %       ±6.01% ±8.01% ±10.46%
 util/type-check.js n=100000 argument='false-object' version='native' type='TypedArray'                  *     -4.58 %       ±3.60% ±4.80%  ±6.26%
 util/type-check.js n=100000 argument='false-object' version='native' type='Uint8Array'                         0.02 %       ±5.28% ±7.03%  ±9.16%
 util/type-check.js n=100000 argument='false-primitive' version='js' type='ArrayBufferView'                     0.03 %       ±5.51% ±7.35%  ±9.58%
 util/type-check.js n=100000 argument='false-primitive' version='js' type='TypedArray'                          0.03 %       ±4.33% ±5.76%  ±7.50%
 util/type-check.js n=100000 argument='false-primitive' version='js' type='Uint8Array'                   *      5.27 %       ±5.26% ±7.05%  ±9.26%
 util/type-check.js n=100000 argument='false-primitive' version='native' type='ArrayBufferView'                -1.35 %       ±4.96% ±6.60%  ±8.59%
 util/type-check.js n=100000 argument='false-primitive' version='native' type='TypedArray'                     -1.97 %       ±6.03% ±8.02% ±10.44%
 util/type-check.js n=100000 argument='false-primitive' version='native' type='Uint8Array'                      3.81 %       ±4.86% ±6.48%  ±8.48%
 util/type-check.js n=100000 argument='true' version='js' type='ArrayBufferView'                                0.39 %       ±4.50% ±5.99%  ±7.80%
 util/type-check.js n=100000 argument='true' version='js' type='TypedArray'                                     0.84 %       ±5.75% ±7.65%  ±9.97%
 util/type-check.js n=100000 argument='true' version='js' type='Uint8Array'                                    -3.32 %       ±4.48% ±5.97%  ±7.77%
 util/type-check.js n=100000 argument='true' version='native' type='ArrayBufferView'                           -0.07 %       ±4.95% ±6.59%  ±8.58%
 util/type-check.js n=100000 argument='true' version='native' type='TypedArray'                                 0.93 %       ±4.92% ±6.56%  ±8.56%
 util/type-check.js n=100000 argument='true' version='native' type='Uint8Array'                                 0.41 %       ±4.78% ±6.36%  ±8.28%

@aduh95 aduh95 marked this pull request as draft December 22, 2020 17:43
@aduh95 aduh95 removed the review wanted PRs that need reviews. label Dec 22, 2020
@aduh95 aduh95 marked this pull request as ready for review December 22, 2020 17:55
@aduh95 aduh95 added the review wanted PRs that need reviews. label Dec 25, 2020
Copy link
Member

@Lxxyx Lxxyx left a comment

Choose a reason for hiding this comment

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

LGTM

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

@nodejs-github-bot
Copy link
Collaborator

@aduh95 aduh95 added the request-ci Add this label to start a Jenkins CI on a PR. label Dec 28, 2020
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 28, 2020
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@aduh95 aduh95 added the commit-queue Add this label to land a pull request using GitHub Actions. label Dec 28, 2020
@github-actions github-actions bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Dec 28, 2020
@github-actions
Copy link
Contributor

Landed in d146b25...ecdff81

@github-actions github-actions bot closed this Dec 28, 2020
nodejs-github-bot pushed a commit that referenced this pull request Dec 28, 2020
PR-URL: #36265
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
@aduh95 aduh95 deleted the util-primordials branch December 28, 2020 21:47
danielleadams pushed a commit that referenced this pull request Jan 12, 2021
PR-URL: #36265
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
@danielleadams danielleadams mentioned this pull request Jan 12, 2021
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. lib / src Issues and PRs related to general changes in the lib or src directory. review wanted PRs that need reviews.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants