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: remove multiple noop definition #47327

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

Conversation

deokjinkim
Copy link
Contributor

Define noop in internal/util. And use it elsewhere.

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/http
  • @nodejs/loaders
  • @nodejs/modules
  • @nodejs/net
  • @nodejs/test_runner

@nodejs-github-bot nodejs-github-bot added lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Mar 31, 2023
@deokjinkim deokjinkim added request-ci Add this label to start a Jenkins CI on a PR. needs-ci PRs that need a full CI run. and removed needs-ci PRs that need a full CI run. request-ci Add this label to start a Jenkins CI on a PR. labels Mar 31, 2023
Define `noop` in `internal/util`. And use it elsewhere.
@deokjinkim deokjinkim force-pushed the 230331_lib_remove_multiple_noop branch from 924a16a to 95c28f8 Compare March 31, 2023 04:20
@deokjinkim deokjinkim added the request-ci Add this label to start a Jenkins CI on a PR. label Mar 31, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Mar 31, 2023
@nodejs-github-bot
Copy link
Collaborator

@aduh95 aduh95 added the needs-benchmark-ci PR that need a benchmark CI run. label Mar 31, 2023
@aduh95
Copy link
Contributor

aduh95 commented Mar 31, 2023

Last time we checked, this was not a good idea: #38246 (comment)
Let’s make sure the performance is ok before landing.

@deokjinkim
Copy link
Contributor Author

Last time we checked, this was not a good idea: #38246 (comment) Let’s make sure the performance is ok before landing.

Thank you for feedback. I didn't know that using primordials may cause performance regression.
And actually I don't know how to run benchmark CI. If there are things I have to, please let me know it.

@ljharb
Copy link
Member

ljharb commented Mar 31, 2023

Should there be a noop at all? Engines are pretty good at optimizing an empty inline function, last i was aware.

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.

I'm -1 with this change. I suspect noop in multiple files is going to be less efficient due to be closing on a different module. There is also no line change benefit, because replacing a one liner with another is not really an advancement.

@lpinca
Copy link
Member

lpinca commented Apr 2, 2023

FWIW I see no performance regressions when running the HTTP benchmarks.

                                                                                                  confidence improvement accuracy (*)   (**)   (***)
http/bench-parser.js n=100000 len=16                                                                              0.38 %       ±2.94% ±3.92%  ±5.10%
http/bench-parser.js n=100000 len=32                                                                              0.16 %       ±2.55% ±3.40%  ±4.42%
http/bench-parser.js n=100000 len=4                                                                               0.93 %       ±3.43% ±4.57%  ±5.94%
http/bench-parser.js n=100000 len=8                                                                              -3.67 %       ±3.88% ±5.18%  ±6.75%
http/check_invalid_header_char.js n=1000000 input=''                                                             -1.90 %       ±3.01% ±4.03%  ±5.30%
http/check_invalid_header_char.js n=1000000 input='\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tFoo bar baz'                    -2.15 %       ±3.37% ±4.53%  ±6.01%
http/check_invalid_header_char.js n=1000000 input='\\x7F'                                                         1.25 %       ±3.82% ±5.14%  ±6.81%
http/check_invalid_header_char.js n=1000000 input='1'                                                            -0.10 %       ±1.28% ±1.70%  ±2.21%
http/check_invalid_header_char.js n=1000000 input='20091'                                                        -0.94 %       ±1.00% ±1.33%  ±1.73%
http/check_invalid_header_char.js n=1000000 input='close'                                                        -1.60 %       ±3.79% ±5.09%  ±6.73%
http/check_invalid_header_char.js n=1000000 input='en-US'                                                         0.07 %       ±1.13% ±1.51%  ±1.97%
http/check_invalid_header_char.js n=1000000 input='foo\\nbar'                                                     1.73 %       ±3.50% ±4.71%  ±6.24%
http/check_invalid_header_char.js n=1000000 input='group_acmeair'                                                -1.82 %       ±3.64% ±4.89%  ±6.48%
http/check_invalid_header_char.js n=1000000 input='gzip'                                                         -0.41 %       ±3.93% ±5.23%  ±6.81%
http/check_invalid_header_char.js n=1000000 input='keep-alive'                                                    1.22 %       ±2.95% ±3.97%  ±5.24%
http/check_invalid_header_char.js n=1000000 input='LONG_AND_INVALID'                                              3.12 %       ±4.62% ±6.16%  ±8.05%
http/check_invalid_header_char.js n=1000000 input='private'                                                      -1.17 %       ±3.46% ±4.65%  ±6.15%
http/check_invalid_header_char.js n=1000000 input='SAMEORIGIN'                                                    0.31 %       ±4.30% ±5.73%  ±7.45%
http/check_invalid_header_char.js n=1000000 input='Sat, 07 May 2016 16:54:48 GMT'                                 0.34 %       ±1.85% ±2.46%  ±3.21%
http/check_invalid_header_char.js n=1000000 input='text/html; charset=utf-8'                                     -3.69 %       ±5.27% ±7.10%  ±9.40%
http/check_invalid_header_char.js n=1000000 input='text/plain'                                                   -0.17 %       ±0.82% ±1.09%  ±1.42%
http/check_invalid_header_char.js n=1000000 input='中文呢'                                                        0.75 %       ±1.36% ±1.81%  ±2.36%
http/check_is_http_token.js n=1000000 key=':'                                                                    -0.15 %       ±2.96% ±3.96%  ±5.22%
http/check_is_http_token.js n=1000000 key=':alternate-protocol'                                                  -1.75 %       ±4.18% ±5.62%  ±7.43%
http/check_is_http_token.js n=1000000 key='((((())))'                                                            -1.17 %       ±1.34% ±1.78%  ±2.32%
http/check_is_http_token.js n=1000000 key='@@'                                                                   -0.18 %       ±2.50% ±3.34%  ±4.40%
http/check_is_http_token.js n=1000000 key='Accept-Ranges'                                                         0.89 %       ±5.54% ±7.38%  ±9.63%
http/check_is_http_token.js n=1000000 key='alt-svc'                                                               1.66 %       ±3.54% ±4.77%  ±6.32%
http/check_is_http_token.js n=1000000 key='alternate-protocol:'                                                  -1.12 %       ±1.82% ±2.43%  ±3.20%
http/check_is_http_token.js n=1000000 key='alternate-protocol'                                                   -1.54 %       ±5.21% ±6.93%  ±9.02%
http/check_is_http_token.js n=1000000 key='Cache-Control'                                                        -1.81 %       ±3.41% ±4.58%  ±6.06%
http/check_is_http_token.js n=1000000 key='Connection'                                                            2.88 %       ±4.52% ±6.02%  ±7.83%
http/check_is_http_token.js n=1000000 key='Content-Encoding'                                                      0.21 %       ±1.35% ±1.80%  ±2.34%
http/check_is_http_token.js n=1000000 key='content-length'                                                        0.94 %       ±3.71% ±4.98%  ±6.58%
http/check_is_http_token.js n=1000000 key='Content-Location'                                                      0.53 %       ±1.02% ±1.37%  ±1.80%
http/check_is_http_token.js n=1000000 key='content-type'                                                          0.20 %       ±1.32% ±1.76%  ±2.31%
http/check_is_http_token.js n=1000000 key='Content-Type'                                                          0.58 %       ±0.80% ±1.06%  ±1.39%
http/check_is_http_token.js n=1000000 key='date'                                                                  0.54 %       ±1.16% ±1.55%  ±2.04%
http/check_is_http_token.js n=1000000 key='ETag'                                                                 -1.30 %       ±3.59% ±4.83%  ±6.40%
http/check_is_http_token.js n=1000000 key='Expires'                                                              -0.98 %       ±1.02% ±1.36%  ±1.78%
http/check_is_http_token.js n=1000000 key='Keep-Alive'                                                           -0.33 %       ±1.23% ±1.64%  ±2.14%
http/check_is_http_token.js n=1000000 key='Last-Modified'                                                         2.15 %       ±3.44% ±4.63%  ±6.14%
http/check_is_http_token.js n=1000000 key='location'                                                              0.18 %       ±0.93% ±1.23%  ±1.61%
http/check_is_http_token.js n=1000000 key='server'                                                                0.09 %       ±1.18% ±1.58%  ±2.09%
http/check_is_http_token.js n=1000000 key='Server'                                                                0.53 %       ±0.73% ±0.98%  ±1.27%
http/check_is_http_token.js n=1000000 key='status'                                                                1.20 %       ±3.33% ±4.48%  ±5.92%
http/check_is_http_token.js n=1000000 key='TCN'                                                                   2.27 %       ±3.74% ±5.02%  ±6.63%
http/check_is_http_token.js n=1000000 key='Transfer-Encoding'                                                     1.61 %       ±3.63% ±4.87%  ±6.43%
http/check_is_http_token.js n=1000000 key='Vary'                                                                 -0.06 %       ±1.10% ±1.47%  ±1.92%
http/check_is_http_token.js n=1000000 key='version'                                                               1.32 %       ±3.20% ±4.30%  ±5.68%
http/check_is_http_token.js n=1000000 key='x-frame-options'                                                       1.49 %       ±3.91% ±5.24%  ±6.89%
http/check_is_http_token.js n=1000000 key='x-xss-protection'                                                     -3.81 %       ±5.02% ±6.75%  ±8.94%
http/check_is_http_token.js n=1000000 key='中文呢'                                                                3.33 %       ±4.44% ±5.95%  ±7.84%
http/chunked.js duration=5 c=100 len=1 n=1 benchmarker='wrk'                                               *     -2.69 %       ±2.29% ±3.05%  ±3.97%
http/chunked.js duration=5 c=100 len=1 n=16 benchmarker='wrk'                                                    -1.88 %       ±2.18% ±2.90%  ±3.77%
http/chunked.js duration=5 c=100 len=1 n=4 benchmarker='wrk'                                                      1.49 %       ±3.10% ±4.13%  ±5.38%
http/chunked.js duration=5 c=100 len=1 n=8 benchmarker='wrk'                                                     -0.11 %       ±1.38% ±1.83%  ±2.38%
http/chunked.js duration=5 c=100 len=256 n=1 benchmarker='wrk'                                                   -0.82 %       ±2.57% ±3.42%  ±4.46%
http/chunked.js duration=5 c=100 len=256 n=16 benchmarker='wrk'                                                  -0.01 %       ±1.63% ±2.16%  ±2.82%
http/chunked.js duration=5 c=100 len=256 n=4 benchmarker='wrk'                                                   -0.90 %       ±3.23% ±4.30%  ±5.60%
http/chunked.js duration=5 c=100 len=256 n=8 benchmarker='wrk'                                                   -0.23 %       ±1.55% ±2.06%  ±2.69%
http/chunked.js duration=5 c=100 len=64 n=1 benchmarker='wrk'                                                    -0.34 %       ±2.27% ±3.02%  ±3.93%
http/chunked.js duration=5 c=100 len=64 n=16 benchmarker='wrk'                                                   -1.23 %       ±2.24% ±2.98%  ±3.89%
http/chunked.js duration=5 c=100 len=64 n=4 benchmarker='wrk'                                                     1.06 %       ±3.47% ±4.62%  ±6.02%
http/chunked.js duration=5 c=100 len=64 n=8 benchmarker='wrk'                                                    -0.72 %       ±1.12% ±1.50%  ±1.95%
http/client-request-body.js method='end' len=1024 type='asc' dur=5                                                0.53 %       ±3.44% ±4.58%  ±5.96%
http/client-request-body.js method='end' len=1024 type='buf' dur=5                                               -0.24 %       ±3.96% ±5.27%  ±6.86%
http/client-request-body.js method='end' len=1024 type='utf' dur=5                                               -1.40 %       ±3.30% ±4.40%  ±5.73%
http/client-request-body.js method='end' len=256 type='asc' dur=5                                                -0.80 %       ±3.54% ±4.70%  ±6.12%
http/client-request-body.js method='end' len=256 type='buf' dur=5                                                -0.91 %       ±2.48% ±3.30%  ±4.30%
http/client-request-body.js method='end' len=256 type='utf' dur=5                                                 0.54 %       ±3.36% ±4.47%  ±5.82%
http/client-request-body.js method='end' len=32 type='asc' dur=5                                                 -2.04 %       ±3.46% ±4.61%  ±6.00%
http/client-request-body.js method='end' len=32 type='buf' dur=5                                                 -0.11 %       ±3.08% ±4.10%  ±5.34%
http/client-request-body.js method='end' len=32 type='utf' dur=5                                           *     -3.98 %       ±3.16% ±4.21%  ±5.49%
http/client-request-body.js method='write' len=1024 type='asc' dur=5                                              0.45 %       ±3.47% ±4.62%  ±6.02%
http/client-request-body.js method='write' len=1024 type='buf' dur=5                                             -1.18 %       ±3.45% ±4.60%  ±6.00%
http/client-request-body.js method='write' len=1024 type='utf' dur=5                                              0.03 %       ±2.88% ±3.84%  ±4.99%
http/client-request-body.js method='write' len=256 type='asc' dur=5                                              -2.08 %       ±3.42% ±4.55%  ±5.92%
http/client-request-body.js method='write' len=256 type='buf' dur=5                                        *     -2.64 %       ±2.60% ±3.47%  ±4.52%
http/client-request-body.js method='write' len=256 type='utf' dur=5                                              -0.14 %       ±3.01% ±4.01%  ±5.22%
http/client-request-body.js method='write' len=32 type='asc' dur=5                                               -1.90 %       ±2.12% ±2.81%  ±3.66%
http/client-request-body.js method='write' len=32 type='buf' dur=5                                               -0.70 %       ±3.29% ±4.38%  ±5.70%
http/client-request-body.js method='write' len=32 type='utf' dur=5                                               -3.22 %       ±3.77% ±5.05%  ±6.62%
http/cluster.js duration=5 c=50 len=1024 type='buffer' benchmarker='wrk'                                          2.13 %       ±4.66% ±6.20%  ±8.07%
http/cluster.js duration=5 c=50 len=1024 type='bytes' benchmarker='wrk'                                           3.33 %       ±5.63% ±7.49%  ±9.76%
http/cluster.js duration=5 c=50 len=102400 type='buffer' benchmarker='wrk'                                       -0.09 %       ±3.72% ±4.95%  ±6.45%
http/cluster.js duration=5 c=50 len=102400 type='bytes' benchmarker='wrk'                                         0.31 %       ±1.40% ±1.86%  ±2.42%
http/cluster.js duration=5 c=50 len=4 type='buffer' benchmarker='wrk'                                            -5.21 %       ±6.40% ±8.52% ±11.11%
http/cluster.js duration=5 c=50 len=4 type='bytes' benchmarker='wrk'                                              1.44 %       ±5.33% ±7.10%  ±9.25%
http/cluster.js duration=5 c=500 len=1024 type='buffer' benchmarker='wrk'                                         0.02 %       ±1.70% ±2.27%  ±2.95%
http/cluster.js duration=5 c=500 len=1024 type='bytes' benchmarker='wrk'                                         -1.88 %       ±1.89% ±2.52%  ±3.28%
http/cluster.js duration=5 c=500 len=102400 type='buffer' benchmarker='wrk'                                      -0.89 %       ±1.91% ±2.55%  ±3.32%
http/cluster.js duration=5 c=500 len=102400 type='bytes' benchmarker='wrk'                                       -0.94 %       ±1.31% ±1.75%  ±2.28%
http/cluster.js duration=5 c=500 len=4 type='buffer' benchmarker='wrk'                                           -1.46 %       ±1.61% ±2.15%  ±2.81%
http/cluster.js duration=5 c=500 len=4 type='bytes' benchmarker='wrk'                                            -1.90 %       ±2.09% ±2.78%  ±3.62%
http/create-clientrequest.js e=1 arg='options' url='idn'                                                         -1.08 %       ±2.47% ±3.30%  ±4.30%
http/create-clientrequest.js e=1 arg='options' url='long'                                                        -1.06 %       ±2.60% ±3.48%  ±4.57%
http/create-clientrequest.js e=1 arg='options' url='wpt'                                                          0.69 %       ±2.93% ±3.91%  ±5.10%
http/create-clientrequest.js e=1 arg='string' url='idn'                                                           0.08 %       ±2.06% ±2.74%  ±3.57%
http/create-clientrequest.js e=1 arg='string' url='long'                                                          1.74 %       ±2.66% ±3.55%  ±4.62%
http/create-clientrequest.js e=1 arg='string' url='wpt'                                                           1.04 %       ±2.81% ±3.74%  ±4.87%
http/create-clientrequest.js e=1 arg='URL' url='idn'                                                              1.83 %       ±2.64% ±3.52%  ±4.58%
http/create-clientrequest.js e=1 arg='URL' url='long'                                                            -0.36 %       ±2.07% ±2.75%  ±3.58%
http/create-clientrequest.js e=1 arg='URL' url='wpt'                                                             -0.76 %       ±2.46% ±3.27%  ±4.25%
http/end-vs-write-end.js duration=5 method='end' c=100 len=1048576 type='asc' benchmarker='wrk'                   0.18 %       ±1.14% ±1.52%  ±1.98%
http/end-vs-write-end.js duration=5 method='end' c=100 len=1048576 type='buf' benchmarker='wrk'                   1.58 %       ±1.65% ±2.20%  ±2.87%
http/end-vs-write-end.js duration=5 method='end' c=100 len=1048576 type='utf' benchmarker='wrk'                   0.86 %       ±1.08% ±1.44%  ±1.88%
http/end-vs-write-end.js duration=5 method='end' c=100 len=131072 type='asc' benchmarker='wrk'                   -0.26 %       ±1.69% ±2.25%  ±2.93%
http/end-vs-write-end.js duration=5 method='end' c=100 len=131072 type='buf' benchmarker='wrk'                    0.08 %       ±1.69% ±2.26%  ±2.96%
http/end-vs-write-end.js duration=5 method='end' c=100 len=131072 type='utf' benchmarker='wrk'                   -0.66 %       ±1.40% ±1.87%  ±2.44%
http/end-vs-write-end.js duration=5 method='end' c=100 len=262144 type='asc' benchmarker='wrk'                   -0.01 %       ±1.30% ±1.73%  ±2.25%
http/end-vs-write-end.js duration=5 method='end' c=100 len=262144 type='buf' benchmarker='wrk'                   -0.97 %       ±1.68% ±2.24%  ±2.93%
http/end-vs-write-end.js duration=5 method='end' c=100 len=262144 type='utf' benchmarker='wrk'                    0.91 %       ±1.17% ±1.56%  ±2.04%
http/end-vs-write-end.js duration=5 method='end' c=100 len=65536 type='asc' benchmarker='wrk'                    -1.43 %       ±1.62% ±2.16%  ±2.82%
http/end-vs-write-end.js duration=5 method='end' c=100 len=65536 type='buf' benchmarker='wrk'                    -0.84 %       ±1.74% ±2.32%  ±3.02%
http/end-vs-write-end.js duration=5 method='end' c=100 len=65536 type='utf' benchmarker='wrk'                    -1.08 %       ±1.29% ±1.72%  ±2.24%
http/end-vs-write-end.js duration=5 method='write' c=100 len=1048576 type='asc' benchmarker='wrk'         **      1.59 %       ±1.15% ±1.54%  ±2.00%
http/end-vs-write-end.js duration=5 method='write' c=100 len=1048576 type='buf' benchmarker='wrk'                -0.13 %       ±1.54% ±2.06%  ±2.68%
http/end-vs-write-end.js duration=5 method='write' c=100 len=1048576 type='utf' benchmarker='wrk'                 0.44 %       ±0.87% ±1.16%  ±1.51%
http/end-vs-write-end.js duration=5 method='write' c=100 len=131072 type='asc' benchmarker='wrk'                 -1.11 %       ±1.31% ±1.75%  ±2.28%
http/end-vs-write-end.js duration=5 method='write' c=100 len=131072 type='buf' benchmarker='wrk'                 -0.04 %       ±1.30% ±1.73%  ±2.25%
http/end-vs-write-end.js duration=5 method='write' c=100 len=131072 type='utf' benchmarker='wrk'                 -0.07 %       ±1.10% ±1.46%  ±1.90%
http/end-vs-write-end.js duration=5 method='write' c=100 len=262144 type='asc' benchmarker='wrk'                 -0.72 %       ±1.22% ±1.62%  ±2.11%
http/end-vs-write-end.js duration=5 method='write' c=100 len=262144 type='buf' benchmarker='wrk'                 -0.68 %       ±1.60% ±2.13%  ±2.77%
http/end-vs-write-end.js duration=5 method='write' c=100 len=262144 type='utf' benchmarker='wrk'                  0.20 %       ±1.10% ±1.47%  ±1.91%
http/end-vs-write-end.js duration=5 method='write' c=100 len=65536 type='asc' benchmarker='wrk'                   0.49 %       ±2.04% ±2.72%  ±3.54%
http/end-vs-write-end.js duration=5 method='write' c=100 len=65536 type='buf' benchmarker='wrk'                   0.77 %       ±1.98% ±2.64%  ±3.44%
http/end-vs-write-end.js duration=5 method='write' c=100 len=65536 type='utf' benchmarker='wrk'                  -1.18 %       ±1.58% ±2.10%  ±2.74%
http/headers.js duration=5 len=1 n=10 benchmarker='wrk'                                                           1.23 %       ±7.03% ±9.35% ±12.18%
http/headers.js duration=5 len=1 n=600 benchmarker='wrk'                                                          0.71 %       ±2.81% ±3.74%  ±4.87%
http/headers.js duration=5 len=100 n=10 benchmarker='wrk'                                                         0.03 %       ±3.82% ±5.08%  ±6.61%
http/headers.js duration=5 len=100 n=600 benchmarker='wrk'                                                        0.53 %       ±1.82% ±2.42%  ±3.15%
http/http_server_for_chunky_client.js type='send' n=2000 len=1                                                    1.05 %       ±2.60% ±3.45%  ±4.50%
http/http_server_for_chunky_client.js type='send' n=2000 len=128                                                 -1.19 %       ±3.19% ±4.25%  ±5.53%
http/http_server_for_chunky_client.js type='send' n=2000 len=16                                                   0.93 %       ±2.52% ±3.35%  ±4.37%
http/http_server_for_chunky_client.js type='send' n=2000 len=32                                            *      3.06 %       ±2.56% ±3.42%  ±4.47%
http/http_server_for_chunky_client.js type='send' n=2000 len=4                                                   -0.14 %       ±3.50% ±4.66%  ±6.07%
http/http_server_for_chunky_client.js type='send' n=2000 len=64                                                   1.74 %       ±3.18% ±4.24%  ±5.53%
http/http_server_for_chunky_client.js type='send' n=2000 len=8                                                    0.32 %       ±2.99% ±3.99%  ±5.19%
http/http_server_for_chunky_client.js type='send' n=5 len=1                                                       2.69 %       ±4.03% ±5.37%  ±7.00%
http/http_server_for_chunky_client.js type='send' n=5 len=128                                                    -4.34 %       ±6.10% ±8.14% ±10.63%
http/http_server_for_chunky_client.js type='send' n=5 len=16                                                      2.23 %       ±5.46% ±7.29%  ±9.53%
http/http_server_for_chunky_client.js type='send' n=5 len=32                                                     -0.35 %       ±4.69% ±6.25%  ±8.15%
http/http_server_for_chunky_client.js type='send' n=5 len=4                                                       3.39 %       ±5.70% ±7.60%  ±9.90%
http/http_server_for_chunky_client.js type='send' n=5 len=64                                                      1.10 %       ±4.39% ±5.86%  ±7.67%
http/http_server_for_chunky_client.js type='send' n=5 len=8                                                       1.51 %       ±3.74% ±4.98%  ±6.50%
http/http_server_for_chunky_client.js type='send' n=50 len=1                                                     -1.68 %       ±6.64% ±8.83% ±11.49%
http/http_server_for_chunky_client.js type='send' n=50 len=128                                                    2.91 %       ±7.27% ±9.70% ±12.68%
http/http_server_for_chunky_client.js type='send' n=50 len=16                                                    -1.26 %       ±7.00% ±9.32% ±12.16%
http/http_server_for_chunky_client.js type='send' n=50 len=32                                                     1.14 %       ±5.80% ±7.71% ±10.04%
http/http_server_for_chunky_client.js type='send' n=50 len=4                                                      1.55 %       ±5.86% ±7.80% ±10.15%
http/http_server_for_chunky_client.js type='send' n=50 len=64                                                    -5.33 %       ±5.57% ±7.42%  ±9.65%
http/http_server_for_chunky_client.js type='send' n=50 len=8                                                     -2.80 %       ±6.06% ±8.07% ±10.51%
http/http_server_for_chunky_client.js type='send' n=500 len=1                                                     1.78 %       ±4.67% ±6.22%  ±8.11%
http/http_server_for_chunky_client.js type='send' n=500 len=128                                                  -1.98 %       ±6.38% ±8.48% ±11.05%
http/http_server_for_chunky_client.js type='send' n=500 len=16                                                   -5.42 %       ±6.44% ±8.59% ±11.21%
http/http_server_for_chunky_client.js type='send' n=500 len=32                                                   -1.56 %       ±6.57% ±8.74% ±11.38%
http/http_server_for_chunky_client.js type='send' n=500 len=4                                                    -2.12 %       ±6.14% ±8.16% ±10.63%
http/http_server_for_chunky_client.js type='send' n=500 len=64                                                    1.10 %       ±5.53% ±7.35%  ±9.57%
http/http_server_for_chunky_client.js type='send' n=500 len=8                                                    -1.90 %       ±6.19% ±8.24% ±10.72%
http/incoming_headers.js duration=5 w=0 headers=20 connections=50 benchmarker='wrk'                              -3.20 %       ±3.70% ±4.92%  ±6.41%
http/incoming_headers.js duration=5 w=6 headers=20 connections=50 benchmarker='wrk'                        *     -3.30 %       ±3.07% ±4.08%  ±5.32%
http/set_header.js n=1000000 value='Connection'                                                                  -0.02 %       ±4.48% ±5.96%  ±7.76%
http/set_header.js n=1000000 value='Content-Length'                                                               0.47 %       ±3.02% ±4.02%  ±5.25%
http/set_header.js n=1000000 value='Content-Type'                                                                -2.17 %       ±4.85% ±6.46%  ±8.42%
http/set_header.js n=1000000 value='Set-Cookie'                                                                   1.49 %       ±5.07% ±6.74%  ±8.77%
http/set_header.js n=1000000 value='Transfer-Encoding'                                                           -1.83 %       ±4.19% ±5.57%  ±7.26%
http/set_header.js n=1000000 value='Vary'                                                                  *     -5.87 %       ±5.70% ±7.59%  ±9.90%
http/set_header.js n=1000000 value='X-Powered-By'                                                                 1.01 %       ±4.43% ±5.90%  ±7.70%
http/set-header.js duration=5 res='normal' benchmarker='wrk'                                                     -0.59 %       ±3.35% ±4.46%  ±5.80%
http/set-header.js duration=5 res='setHeader' benchmarker='wrk'                                                   0.58 %       ±3.01% ±4.01%  ±5.23%
http/set-header.js duration=5 res='setHeaderWH' benchmarker='wrk'                                          *     -4.12 %       ±3.56% ±4.74%  ±6.17%
http/simple.js duration=5 chunkedEnc=0 c=50 chunks=1 len=1024 type='buffer' benchmarker='wrk'                     0.12 %       ±3.21% ±4.27%  ±5.56%
http/simple.js duration=5 chunkedEnc=0 c=50 chunks=1 len=1024 type='bytes' benchmarker='wrk'                     -0.33 %       ±2.89% ±3.85%  ±5.02%
http/simple.js duration=5 chunkedEnc=0 c=50 chunks=1 len=102400 type='buffer' benchmarker='wrk'                  -0.03 %       ±2.11% ±2.80%  ±3.65%
http/simple.js duration=5 chunkedEnc=0 c=50 chunks=1 len=102400 type='bytes' benchmarker='wrk'                   -0.69 %       ±1.29% ±1.72%  ±2.24%
http/simple.js duration=5 chunkedEnc=0 c=50 chunks=1 len=4 type='buffer' benchmarker='wrk'                        0.72 %       ±3.16% ±4.21%  ±5.48%
http/simple.js duration=5 chunkedEnc=0 c=50 chunks=1 len=4 type='bytes' benchmarker='wrk'                        -0.92 %       ±3.14% ±4.18%  ±5.44%
http/simple.js duration=5 chunkedEnc=0 c=50 chunks=4 len=1024 type='buffer' benchmarker='wrk'                    -2.35 %       ±4.13% ±5.50%  ±7.17%
http/simple.js duration=5 chunkedEnc=0 c=50 chunks=4 len=1024 type='bytes' benchmarker='wrk'                     -1.50 %       ±2.83% ±3.78%  ±4.94%
http/simple.js duration=5 chunkedEnc=0 c=50 chunks=4 len=102400 type='buffer' benchmarker='wrk'                   0.09 %       ±1.84% ±2.45%  ±3.19%
http/simple.js duration=5 chunkedEnc=0 c=50 chunks=4 len=102400 type='bytes' benchmarker='wrk'                   -1.13 %       ±1.76% ±2.34%  ±3.05%
http/simple.js duration=5 chunkedEnc=0 c=50 chunks=4 len=4 type='buffer' benchmarker='wrk'                 *     -3.31 %       ±3.29% ±4.37%  ±5.69%
http/simple.js duration=5 chunkedEnc=0 c=50 chunks=4 len=4 type='bytes' benchmarker='wrk'                        -2.44 %       ±3.70% ±4.93%  ±6.42%
http/simple.js duration=5 chunkedEnc=0 c=500 chunks=1 len=1024 type='buffer' benchmarker='wrk'                    0.28 %       ±3.29% ±4.38%  ±5.70%
http/simple.js duration=5 chunkedEnc=0 c=500 chunks=1 len=1024 type='bytes' benchmarker='wrk'                    -1.09 %       ±2.97% ±3.95%  ±5.15%
http/simple.js duration=5 chunkedEnc=0 c=500 chunks=1 len=102400 type='buffer' benchmarker='wrk'                 -0.22 %       ±2.52% ±3.36%  ±4.37%
http/simple.js duration=5 chunkedEnc=0 c=500 chunks=1 len=102400 type='bytes' benchmarker='wrk'                  -0.55 %       ±5.03% ±6.70%  ±8.73%
http/simple.js duration=5 chunkedEnc=0 c=500 chunks=1 len=4 type='buffer' benchmarker='wrk'                      -0.38 %       ±3.09% ±4.11%  ±5.36%
http/simple.js duration=5 chunkedEnc=0 c=500 chunks=1 len=4 type='bytes' benchmarker='wrk'                       -2.51 %       ±3.05% ±4.05%  ±5.27%
http/simple.js duration=5 chunkedEnc=0 c=500 chunks=4 len=1024 type='buffer' benchmarker='wrk'                   -0.78 %       ±2.62% ±3.48%  ±4.53%
http/simple.js duration=5 chunkedEnc=0 c=500 chunks=4 len=1024 type='bytes' benchmarker='wrk'                    -0.74 %       ±2.68% ±3.57%  ±4.65%
http/simple.js duration=5 chunkedEnc=0 c=500 chunks=4 len=102400 type='buffer' benchmarker='wrk'                 -0.61 %       ±2.14% ±2.85%  ±3.71%
http/simple.js duration=5 chunkedEnc=0 c=500 chunks=4 len=102400 type='bytes' benchmarker='wrk'                   3.02 %       ±3.25% ±4.35%  ±5.69%
http/simple.js duration=5 chunkedEnc=0 c=500 chunks=4 len=4 type='buffer' benchmarker='wrk'                       0.54 %       ±2.61% ±3.48%  ±4.53%
http/simple.js duration=5 chunkedEnc=0 c=500 chunks=4 len=4 type='bytes' benchmarker='wrk'                        0.53 %       ±2.92% ±3.89%  ±5.06%
http/simple.js duration=5 chunkedEnc=1 c=50 chunks=1 len=1024 type='buffer' benchmarker='wrk'                    -0.80 %       ±3.26% ±4.34%  ±5.65%
http/simple.js duration=5 chunkedEnc=1 c=50 chunks=1 len=1024 type='bytes' benchmarker='wrk'               *     -3.08 %       ±2.81% ±3.74%  ±4.87%
http/simple.js duration=5 chunkedEnc=1 c=50 chunks=1 len=102400 type='buffer' benchmarker='wrk'                   1.38 %       ±1.97% ±2.62%  ±3.42%
http/simple.js duration=5 chunkedEnc=1 c=50 chunks=1 len=102400 type='bytes' benchmarker='wrk'                   -0.64 %       ±1.84% ±2.45%  ±3.18%
http/simple.js duration=5 chunkedEnc=1 c=50 chunks=1 len=4 type='buffer' benchmarker='wrk'                       -1.81 %       ±2.80% ±3.74%  ±4.88%
http/simple.js duration=5 chunkedEnc=1 c=50 chunks=1 len=4 type='bytes' benchmarker='wrk'                         1.56 %       ±3.36% ±4.47%  ±5.83%
http/simple.js duration=5 chunkedEnc=1 c=50 chunks=4 len=1024 type='buffer' benchmarker='wrk'                    -1.45 %       ±2.82% ±3.75%  ±4.90%
http/simple.js duration=5 chunkedEnc=1 c=50 chunks=4 len=1024 type='bytes' benchmarker='wrk'                     -1.38 %       ±2.33% ±3.10%  ±4.04%
http/simple.js duration=5 chunkedEnc=1 c=50 chunks=4 len=102400 type='buffer' benchmarker='wrk'                  -0.68 %       ±1.47% ±1.95%  ±2.54%
http/simple.js duration=5 chunkedEnc=1 c=50 chunks=4 len=102400 type='bytes' benchmarker='wrk'                   -1.09 %       ±1.36% ±1.81%  ±2.36%
http/simple.js duration=5 chunkedEnc=1 c=50 chunks=4 len=4 type='buffer' benchmarker='wrk'                       -1.00 %       ±2.47% ±3.29%  ±4.28%
http/simple.js duration=5 chunkedEnc=1 c=50 chunks=4 len=4 type='bytes' benchmarker='wrk'                        -2.51 %       ±2.87% ±3.82%  ±4.97%
http/simple.js duration=5 chunkedEnc=1 c=500 chunks=1 len=1024 type='buffer' benchmarker='wrk'                   -1.10 %       ±3.20% ±4.26%  ±5.55%
http/simple.js duration=5 chunkedEnc=1 c=500 chunks=1 len=1024 type='bytes' benchmarker='wrk'                    -0.53 %       ±3.03% ±4.04%  ±5.27%
http/simple.js duration=5 chunkedEnc=1 c=500 chunks=1 len=102400 type='buffer' benchmarker='wrk'                 -0.29 %       ±2.17% ±2.89%  ±3.76%
http/simple.js duration=5 chunkedEnc=1 c=500 chunks=1 len=102400 type='bytes' benchmarker='wrk'                   0.71 %       ±1.65% ±2.20%  ±2.86%
http/simple.js duration=5 chunkedEnc=1 c=500 chunks=1 len=4 type='buffer' benchmarker='wrk'                *     -3.79 %       ±3.37% ±4.49%  ±5.84%
http/simple.js duration=5 chunkedEnc=1 c=500 chunks=1 len=4 type='bytes' benchmarker='wrk'                        0.43 %       ±3.21% ±4.27%  ±5.56%
http/simple.js duration=5 chunkedEnc=1 c=500 chunks=4 len=1024 type='buffer' benchmarker='wrk'                   -1.09 %       ±3.13% ±4.16%  ±5.43%
http/simple.js duration=5 chunkedEnc=1 c=500 chunks=4 len=1024 type='bytes' benchmarker='wrk'                    -0.44 %       ±2.24% ±2.99%  ±3.89%
http/simple.js duration=5 chunkedEnc=1 c=500 chunks=4 len=102400 type='buffer' benchmarker='wrk'                 -1.20 %       ±2.19% ±2.92%  ±3.80%
http/simple.js duration=5 chunkedEnc=1 c=500 chunks=4 len=102400 type='bytes' benchmarker='wrk'                  -0.14 %       ±1.77% ±2.35%  ±3.06%
http/simple.js duration=5 chunkedEnc=1 c=500 chunks=4 len=4 type='buffer' benchmarker='wrk'                      -0.38 %       ±2.99% ±3.99%  ±5.20%
http/simple.js duration=5 chunkedEnc=1 c=500 chunks=4 len=4 type='bytes' benchmarker='wrk'                        0.07 %       ±2.54% ±3.38%  ±4.40%
http/upgrade.js n=1000                                                                                            0.42 %       ±1.94% ±2.58%  ±3.36%
http/upgrade.js n=5                                                                                               1.03 %       ±3.74% ±4.97%  ±6.47%

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

@ljharb
Copy link
Member

ljharb commented Apr 2, 2023

What if all noop functions are replaced with actual empty arrow functions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lib / src Issues and PRs related to general changes in the lib or src directory. needs-benchmark-ci PR that need a benchmark CI run. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants