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

http: remove prototype primordials #53698

Merged
merged 3 commits into from
Jul 6, 2024
Merged

Conversation

aduh95
Copy link
Contributor

@aduh95 aduh95 commented Jul 2, 2024

Yagiz and I paired to remove primordials in http files, as those are really just a JS lib that happens to be in core, not something for which prototype pollution is a big concern.

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/http
  • @nodejs/net
  • @nodejs/tsc
@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 Jul 2, 2024
@aduh95 aduh95 added the dont-land-on-v18.x PRs that should not land on the v18.x-staging branch and should not be released in v18.x. label Jul 2, 2024
Copy link
Member

@ronag ronag left a comment

Choose a reason for hiding this comment

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

❤️

lpinca

This comment was marked as duplicate.

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.

lgtm

@GeoffreyBooth
Copy link
Member

Is there a benchmark that would measure the difference that this change makes?

lib/_http_agent.js Outdated Show resolved Hide resolved
@aduh95
Copy link
Contributor Author

aduh95 commented Jul 3, 2024

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

Results
                                                                                                  confidence improvement accuracy (*)   (**)  (***)
http/bench-parser.js n=100000 len=16                                                                              0.67 %       ±0.77% ±1.03% ±1.34%
http/bench-parser.js n=100000 len=32                                                                             -0.22 %       ±0.71% ±0.94% ±1.23%
http/bench-parser.js n=100000 len=4                                                                               0.41 %       ±0.70% ±0.93% ±1.22%
http/bench-parser.js n=100000 len=8                                                                               0.04 %       ±0.74% ±0.99% ±1.29%
http/check_invalid_header_char.js n=1000000 input=''                                                     ***      9.30 %       ±3.71% ±4.94% ±6.44%
http/check_invalid_header_char.js n=1000000 input='\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tFoo bar baz'                     1.42 %       ±2.06% ±2.74% ±3.56%
http/check_invalid_header_char.js n=1000000 input='\\x7F'                                                ***     82.73 %       ±3.72% ±4.99% ±6.58%
http/check_invalid_header_char.js n=1000000 input='1'                                                    ***      7.58 %       ±4.12% ±5.49% ±7.16%
http/check_invalid_header_char.js n=1000000 input='20091'                                                ***      7.91 %       ±3.61% ±4.81% ±6.26%
http/check_invalid_header_char.js n=1000000 input='close'                                                  *      3.61 %       ±3.09% ±4.12% ±5.36%
http/check_invalid_header_char.js n=1000000 input='en-US'                                                ***      6.82 %       ±3.33% ±4.45% ±5.82%
http/check_invalid_header_char.js n=1000000 input='foo\\nbar'                                            ***     30.09 %       ±2.79% ±3.73% ±4.88%
http/check_invalid_header_char.js n=1000000 input='group_acmeair'                                        ***      7.27 %       ±2.82% ±3.76% ±4.92%
http/check_invalid_header_char.js n=1000000 input='gzip'                                                 ***      5.19 %       ±2.85% ±3.79% ±4.93%
http/check_invalid_header_char.js n=1000000 input='keep-alive'                                             *      3.20 %       ±2.76% ±3.69% ±4.82%
http/check_invalid_header_char.js n=1000000 input='LONG_AND_INVALID'                                     ***     10.29 %       ±0.93% ±1.24% ±1.61%
http/check_invalid_header_char.js n=1000000 input='private'                                               **      4.42 %       ±2.72% ±3.62% ±4.71%
http/check_invalid_header_char.js n=1000000 input='SAMEORIGIN'                                            **      3.05 %       ±2.08% ±2.79% ±3.68%
http/check_invalid_header_char.js n=1000000 input='Sat, 07 May 2016 16:54:48 GMT'                                 1.70 %       ±1.74% ±2.32% ±3.03%
http/check_invalid_header_char.js n=1000000 input='text/html; charset=utf-8'                             ***      9.14 %       ±3.40% ±4.54% ±5.92%
http/check_invalid_header_char.js n=1000000 input='text/plain'                                           ***      5.16 %       ±2.53% ±3.37% ±4.39%
http/check_invalid_header_char.js n=1000000 input='中文呢'                                               ***     37.34 %       ±3.66% ±4.91% ±6.45%
http/check_is_http_token.js n=1000000 key=':'                                                            ***     15.89 %       ±5.68% ±7.60% ±9.96%
http/check_is_http_token.js n=1000000 key=':alternate-protocol'                                          ***     17.50 %       ±3.71% ±4.94% ±6.44%
http/check_is_http_token.js n=1000000 key='((((())))'                                                    ***     21.53 %       ±3.75% ±5.01% ±6.58%
http/check_is_http_token.js n=1000000 key='@@'                                                           ***     20.26 %       ±3.04% ±4.09% ±5.39%
http/check_is_http_token.js n=1000000 key='Accept-Ranges'                                                ***     34.80 %       ±2.52% ±3.35% ±4.37%
http/check_is_http_token.js n=1000000 key='alt-svc'                                                      ***     37.58 %       ±3.69% ±4.94% ±6.47%
http/check_is_http_token.js n=1000000 key='alternate-protocol:'                                          ***      5.45 %       ±2.15% ±2.87% ±3.74%
http/check_is_http_token.js n=1000000 key='alternate-protocol'                                           ***     35.33 %       ±2.84% ±3.78% ±4.93%
http/check_is_http_token.js n=1000000 key='Cache-Control'                                                ***     34.79 %       ±2.53% ±3.39% ±4.45%
http/check_is_http_token.js n=1000000 key='Connection'                                                   ***     40.47 %       ±2.32% ±3.09% ±4.04%
http/check_is_http_token.js n=1000000 key='Content-Encoding'                                             ***     31.88 %       ±2.63% ±3.52% ±4.62%
http/check_is_http_token.js n=1000000 key='content-length'                                               ***     36.23 %       ±2.27% ±3.03% ±3.95%
http/check_is_http_token.js n=1000000 key='Content-Location'                                             ***     33.73 %       ±2.46% ±3.27% ±4.26%
http/check_is_http_token.js n=1000000 key='content-type'                                                 ***     29.67 %       ±2.12% ±2.83% ±3.71%
http/check_is_http_token.js n=1000000 key='Content-Type'                                                 ***     28.27 %       ±2.47% ±3.29% ±4.29%
http/check_is_http_token.js n=1000000 key='date'                                                         ***     40.61 %       ±3.65% ±4.89% ±6.44%
http/check_is_http_token.js n=1000000 key='ETag'                                                         ***     37.74 %       ±4.72% ±6.32% ±8.31%
http/check_is_http_token.js n=1000000 key='Expires'                                                      ***     38.93 %       ±2.64% ±3.53% ±4.64%
http/check_is_http_token.js n=1000000 key='Keep-Alive'                                                   ***     35.68 %       ±2.49% ±3.33% ±4.35%
http/check_is_http_token.js n=1000000 key='Last-Modified'                                                ***     35.65 %       ±1.99% ±2.64% ±3.44%
http/check_is_http_token.js n=1000000 key='location'                                                     ***     35.23 %       ±2.90% ±3.90% ±5.15%
http/check_is_http_token.js n=1000000 key='server'                                                       ***     39.02 %       ±3.41% ±4.57% ±6.02%
http/check_is_http_token.js n=1000000 key='Server'                                                       ***     41.28 %       ±1.96% ±2.61% ±3.41%
http/check_is_http_token.js n=1000000 key='status'                                                       ***     41.33 %       ±3.11% ±4.14% ±5.39%
http/check_is_http_token.js n=1000000 key='TCN'                                                          ***     42.72 %       ±2.11% ±2.81% ±3.68%
http/check_is_http_token.js n=1000000 key='Transfer-Encoding'                                            ***     37.08 %       ±2.70% ±3.60% ±4.68%
http/check_is_http_token.js n=1000000 key='Vary'                                                         ***     42.74 %       ±3.88% ±5.18% ±6.76%
http/check_is_http_token.js n=1000000 key='version'                                                      ***     37.85 %       ±3.84% ±5.14% ±6.75%
http/check_is_http_token.js n=1000000 key='x-frame-options'                                              ***     31.87 %       ±2.89% ±3.86% ±5.05%
http/check_is_http_token.js n=1000000 key='x-xss-protection'                                             ***     33.25 %       ±2.23% ±2.97% ±3.86%
http/check_is_http_token.js n=1000000 key='中文呢'                                                       ***     13.67 %       ±3.87% ±5.15% ±6.72%
http/chunked.js duration=5 c=100 len=1 n=1 benchmarker='wrk'                                                     -0.39 %       ±2.14% ±2.84% ±3.70%
http/chunked.js duration=5 c=100 len=1 n=16 benchmarker='wrk'                                                    -0.05 %       ±0.59% ±0.78% ±1.02%
http/chunked.js duration=5 c=100 len=1 n=4 benchmarker='wrk'                                                      0.33 %       ±0.46% ±0.61% ±0.79%
http/chunked.js duration=5 c=100 len=1 n=8 benchmarker='wrk'                                                      0.53 %       ±0.80% ±1.06% ±1.38%
http/chunked.js duration=5 c=100 len=256 n=1 benchmarker='wrk'                                                   -0.50 %       ±2.08% ±2.77% ±3.61%
http/chunked.js duration=5 c=100 len=256 n=16 benchmarker='wrk'                                                  -0.26 %       ±0.64% ±0.85% ±1.10%
http/chunked.js duration=5 c=100 len=256 n=4 benchmarker='wrk'                                                   -0.21 %       ±0.67% ±0.89% ±1.16%
http/chunked.js duration=5 c=100 len=256 n=8 benchmarker='wrk'                                                   -0.08 %       ±0.77% ±1.03% ±1.34%
http/chunked.js duration=5 c=100 len=64 n=1 benchmarker='wrk'                                             **      2.54 %       ±1.90% ±2.52% ±3.28%
http/chunked.js duration=5 c=100 len=64 n=16 benchmarker='wrk'                                                    0.52 %       ±0.71% ±0.94% ±1.23%
http/chunked.js duration=5 c=100 len=64 n=4 benchmarker='wrk'                                                     0.13 %       ±0.56% ±0.74% ±0.97%
http/chunked.js duration=5 c=100 len=64 n=8 benchmarker='wrk'                                                    -0.33 %       ±0.65% ±0.86% ±1.12%
http/client-request-body.js method='end' len=1024 type='asc' dur=5                                                0.33 %       ±0.39% ±0.52% ±0.68%
http/client-request-body.js method='end' len=1024 type='buf' dur=5                                       ***      1.27 %       ±0.37% ±0.49% ±0.64%
http/client-request-body.js method='end' len=1024 type='utf' dur=5                                       ***      1.11 %       ±0.40% ±0.53% ±0.69%
http/client-request-body.js method='end' len=256 type='asc' dur=5                                          *      0.42 %       ±0.38% ±0.50% ±0.65%
http/client-request-body.js method='end' len=256 type='buf' dur=5                                        ***      1.20 %       ±0.33% ±0.44% ±0.58%
http/client-request-body.js method='end' len=256 type='utf' dur=5                                          *      0.51 %       ±0.39% ±0.52% ±0.68%
http/client-request-body.js method='end' len=32 type='asc' dur=5                                         ***      0.89 %       ±0.40% ±0.53% ±0.70%
http/client-request-body.js method='end' len=32 type='buf' dur=5                                         ***      0.91 %       ±0.39% ±0.52% ±0.67%
http/client-request-body.js method='end' len=32 type='utf' dur=5                                         ***      0.85 %       ±0.37% ±0.50% ±0.65%
http/client-request-body.js method='write' len=1024 type='asc' dur=5                                      **      0.63 %       ±0.41% ±0.54% ±0.71%
http/client-request-body.js method='write' len=1024 type='buf' dur=5                                     ***      1.05 %       ±0.45% ±0.60% ±0.78%
http/client-request-body.js method='write' len=1024 type='utf' dur=5                                     ***      0.67 %       ±0.38% ±0.51% ±0.66%
http/client-request-body.js method='write' len=256 type='asc' dur=5                                               0.20 %       ±0.39% ±0.52% ±0.68%
http/client-request-body.js method='write' len=256 type='buf' dur=5                                       **      0.66 %       ±0.40% ±0.54% ±0.70%
http/client-request-body.js method='write' len=256 type='utf' dur=5                                       **      0.63 %       ±0.41% ±0.54% ±0.70%
http/client-request-body.js method='write' len=32 type='asc' dur=5                                         *      0.44 %       ±0.41% ±0.55% ±0.71%
http/client-request-body.js method='write' len=32 type='buf' dur=5                                         *      0.56 %       ±0.43% ±0.57% ±0.74%
http/client-request-body.js method='write' len=32 type='utf' dur=5                                        **      0.60 %       ±0.39% ±0.52% ±0.67%
http/cluster.js duration=5 c=50 len=1024 type='buffer' benchmarker='wrk'                                   *      0.92 %       ±0.71% ±0.95% ±1.24%
http/cluster.js duration=5 c=50 len=1024 type='bytes' benchmarker='wrk'                                   **      1.27 %       ±0.76% ±1.01% ±1.32%
http/cluster.js duration=5 c=50 len=102400 type='buffer' benchmarker='wrk'                                        0.52 %       ±0.60% ±0.79% ±1.04%
http/cluster.js duration=5 c=50 len=102400 type='bytes' benchmarker='wrk'                                 **      1.04 %       ±0.67% ±0.89% ±1.16%
http/cluster.js duration=5 c=50 len=4 type='buffer' benchmarker='wrk'                                      *      0.85 %       ±0.74% ±0.99% ±1.29%
http/cluster.js duration=5 c=50 len=4 type='bytes' benchmarker='wrk'                                     ***      1.35 %       ±0.60% ±0.80% ±1.05%
http/cluster.js duration=5 c=500 len=1024 type='buffer' benchmarker='wrk'                                         0.57 %       ±0.94% ±1.26% ±1.64%
http/cluster.js duration=5 c=500 len=1024 type='bytes' benchmarker='wrk'                                   *      0.99 %       ±0.87% ±1.16% ±1.51%
http/cluster.js duration=5 c=500 len=102400 type='buffer' benchmarker='wrk'                                       0.44 %       ±0.48% ±0.63% ±0.82%
http/cluster.js duration=5 c=500 len=102400 type='bytes' benchmarker='wrk'                                       -0.33 %       ±0.91% ±1.21% ±1.58%
http/cluster.js duration=5 c=500 len=4 type='buffer' benchmarker='wrk'                                    **      1.21 %       ±0.82% ±1.09% ±1.42%
http/cluster.js duration=5 c=500 len=4 type='bytes' benchmarker='wrk'                                     **      1.54 %       ±0.96% ±1.28% ±1.67%
http/create-clientrequest.js e=1 arg='options' url='idn'                                                          0.51 %       ±3.54% ±4.71% ±6.14%
http/create-clientrequest.js e=1 arg='options' url='long'                                                        -0.24 %       ±3.94% ±5.25% ±6.84%
http/create-clientrequest.js e=1 arg='options' url='wpt'                                                         -2.04 %       ±4.57% ±6.09% ±7.96%
http/create-clientrequest.js e=1 arg='string' url='idn'                                                           0.92 %       ±3.95% ±5.26% ±6.85%
http/create-clientrequest.js e=1 arg='string' url='long'                                                          2.91 %       ±5.57% ±7.41% ±9.67%
http/create-clientrequest.js e=1 arg='string' url='wpt'                                                           1.55 %       ±4.23% ±5.65% ±7.39%
http/create-clientrequest.js e=1 arg='URL' url='idn'                                                              1.20 %       ±3.74% ±4.97% ±6.48%
http/create-clientrequest.js e=1 arg='URL' url='long'                                                             0.29 %       ±4.57% ±6.09% ±7.92%
http/create-clientrequest.js e=1 arg='URL' url='wpt'                                                             -0.00 %       ±4.48% ±5.96% ±7.75%
http/end-vs-write-end.js duration=5 method='end' c=100 len=1048576 type='asc' benchmarker='wrk'                  -0.73 %       ±0.86% ±1.14% ±1.49%
http/end-vs-write-end.js duration=5 method='end' c=100 len=1048576 type='buf' benchmarker='wrk'                  -0.04 %       ±0.37% ±0.50% ±0.65%
http/end-vs-write-end.js duration=5 method='end' c=100 len=1048576 type='utf' benchmarker='wrk'                   0.23 %       ±0.26% ±0.34% ±0.45%
http/end-vs-write-end.js duration=5 method='end' c=100 len=131072 type='asc' benchmarker='wrk'                    0.23 %       ±0.32% ±0.43% ±0.56%
http/end-vs-write-end.js duration=5 method='end' c=100 len=131072 type='buf' benchmarker='wrk'                    0.12 %       ±1.54% ±2.05% ±2.67%
http/end-vs-write-end.js duration=5 method='end' c=100 len=131072 type='utf' benchmarker='wrk'                    0.42 %       ±0.67% ±0.89% ±1.16%
http/end-vs-write-end.js duration=5 method='end' c=100 len=262144 type='asc' benchmarker='wrk'                   -0.10 %       ±0.30% ±0.40% ±0.52%
http/end-vs-write-end.js duration=5 method='end' c=100 len=262144 type='buf' benchmarker='wrk'                    0.05 %       ±0.84% ±1.11% ±1.45%
http/end-vs-write-end.js duration=5 method='end' c=100 len=262144 type='utf' benchmarker='wrk'             *      0.43 %       ±0.34% ±0.45% ±0.59%
http/end-vs-write-end.js duration=5 method='end' c=100 len=65536 type='asc' benchmarker='wrk'                     0.13 %       ±0.82% ±1.09% ±1.43%
http/end-vs-write-end.js duration=5 method='end' c=100 len=65536 type='buf' benchmarker='wrk'             **     -2.78 %       ±1.68% ±2.24% ±2.91%
http/end-vs-write-end.js duration=5 method='end' c=100 len=65536 type='utf' benchmarker='wrk'                    -0.41 %       ±0.68% ±0.91% ±1.18%
http/end-vs-write-end.js duration=5 method='write' c=100 len=1048576 type='asc' benchmarker='wrk'                -0.32 %       ±0.34% ±0.46% ±0.60%
http/end-vs-write-end.js duration=5 method='write' c=100 len=1048576 type='buf' benchmarker='wrk'                -0.29 %       ±0.42% ±0.56% ±0.73%
http/end-vs-write-end.js duration=5 method='write' c=100 len=1048576 type='utf' benchmarker='wrk'                 0.00 %       ±0.22% ±0.29% ±0.38%
http/end-vs-write-end.js duration=5 method='write' c=100 len=131072 type='asc' benchmarker='wrk'                  0.30 %       ±0.96% ±1.28% ±1.68%
http/end-vs-write-end.js duration=5 method='write' c=100 len=131072 type='buf' benchmarker='wrk'                  0.41 %       ±1.04% ±1.38% ±1.79%
http/end-vs-write-end.js duration=5 method='write' c=100 len=131072 type='utf' benchmarker='wrk'                 -0.16 %       ±0.56% ±0.74% ±0.97%
http/end-vs-write-end.js duration=5 method='write' c=100 len=262144 type='asc' benchmarker='wrk'                  0.53 %       ±0.70% ±0.94% ±1.22%
http/end-vs-write-end.js duration=5 method='write' c=100 len=262144 type='buf' benchmarker='wrk'                  0.47 %       ±1.05% ±1.40% ±1.83%
http/end-vs-write-end.js duration=5 method='write' c=100 len=262144 type='utf' benchmarker='wrk'                  0.33 %       ±0.69% ±0.92% ±1.21%
http/end-vs-write-end.js duration=5 method='write' c=100 len=65536 type='asc' benchmarker='wrk'           **      1.64 %       ±1.07% ±1.42% ±1.86%
http/end-vs-write-end.js duration=5 method='write' c=100 len=65536 type='buf' benchmarker='wrk'                   0.05 %       ±1.63% ±2.17% ±2.82%
http/end-vs-write-end.js duration=5 method='write' c=100 len=65536 type='utf' benchmarker='wrk'                   0.18 %       ±0.74% ±0.98% ±1.27%
http/headers.js duration=5 len=1 n=10 benchmarker='wrk'                                                           0.59 %       ±1.13% ±1.51% ±1.97%
http/headers.js duration=5 len=1 n=600 benchmarker='wrk'                                                 ***      9.09 %       ±1.03% ±1.37% ±1.79%
http/headers.js duration=5 len=100 n=10 benchmarker='wrk'                                                 **      2.01 %       ±1.19% ±1.59% ±2.08%
http/headers.js duration=5 len=100 n=600 benchmarker='wrk'                                                        0.10 %       ±0.86% ±1.15% ±1.50%
http/http_server_for_chunky_client.js type='send' n=2000 len=1                                                    0.00 %       ±0.69% ±0.92% ±1.20%
http/http_server_for_chunky_client.js type='send' n=2000 len=128                                                  0.27 %       ±0.56% ±0.75% ±0.98%
http/http_server_for_chunky_client.js type='send' n=2000 len=16                                                   0.30 %       ±0.60% ±0.80% ±1.04%
http/http_server_for_chunky_client.js type='send' n=2000 len=32                                                   0.09 %       ±0.62% ±0.82% ±1.07%
http/http_server_for_chunky_client.js type='send' n=2000 len=4                                                    0.10 %       ±0.61% ±0.81% ±1.06%
http/http_server_for_chunky_client.js type='send' n=2000 len=64                                                   0.27 %       ±0.56% ±0.75% ±0.98%
http/http_server_for_chunky_client.js type='send' n=2000 len=8                                                   -0.56 %       ±0.68% ±0.90% ±1.17%
http/http_server_for_chunky_client.js type='send' n=5 len=1                                                      -2.84 %       ±5.24% ±6.97% ±9.08%
http/http_server_for_chunky_client.js type='send' n=5 len=128                                                     1.16 %       ±4.87% ±6.48% ±8.44%
http/http_server_for_chunky_client.js type='send' n=5 len=16                                                     -1.04 %       ±3.84% ±5.11% ±6.65%
http/http_server_for_chunky_client.js type='send' n=5 len=32                                                     -1.03 %       ±4.31% ±5.73% ±7.46%
http/http_server_for_chunky_client.js type='send' n=5 len=4                                                      -2.18 %       ±4.41% ±5.87% ±7.64%
http/http_server_for_chunky_client.js type='send' n=5 len=64                                                     -0.44 %       ±4.76% ±6.34% ±8.25%
http/http_server_for_chunky_client.js type='send' n=5 len=8                                                      -2.02 %       ±4.04% ±5.38% ±7.00%
http/http_server_for_chunky_client.js type='send' n=50 len=1                                               *      2.15 %       ±2.04% ±2.72% ±3.54%
http/http_server_for_chunky_client.js type='send' n=50 len=128                                                   -0.34 %       ±1.06% ±1.41% ±1.84%
http/http_server_for_chunky_client.js type='send' n=50 len=16                                                     0.31 %       ±1.33% ±1.77% ±2.30%
http/http_server_for_chunky_client.js type='send' n=50 len=32                                              *     -1.49 %       ±1.46% ±1.95% ±2.55%
http/http_server_for_chunky_client.js type='send' n=50 len=4                                                     -0.11 %       ±1.31% ±1.74% ±2.27%
http/http_server_for_chunky_client.js type='send' n=50 len=64                                                     0.77 %       ±1.46% ±1.94% ±2.52%
http/http_server_for_chunky_client.js type='send' n=50 len=8                                                      0.50 %       ±1.74% ±2.32% ±3.02%
http/http_server_for_chunky_client.js type='send' n=500 len=1                                                    -0.13 %       ±0.68% ±0.91% ±1.19%
http/http_server_for_chunky_client.js type='send' n=500 len=128                                                  -0.22 %       ±0.52% ±0.70% ±0.91%
http/http_server_for_chunky_client.js type='send' n=500 len=16                                                   -0.06 %       ±0.63% ±0.84% ±1.09%
http/http_server_for_chunky_client.js type='send' n=500 len=32                                                    0.04 %       ±0.54% ±0.73% ±0.95%
http/http_server_for_chunky_client.js type='send' n=500 len=4                                                    -0.44 %       ±0.74% ±0.99% ±1.29%
http/http_server_for_chunky_client.js type='send' n=500 len=64                                                    0.22 %       ±0.69% ±0.92% ±1.20%
http/http_server_for_chunky_client.js type='send' n=500 len=8                                                    -0.10 %       ±0.71% ±0.94% ±1.23%
http/incoming_headers.js duration=5 w=0 headers=20 connections=50 benchmarker='wrk'                               0.76 %       ±0.98% ±1.31% ±1.71%
http/incoming_headers.js duration=5 w=6 headers=20 connections=50 benchmarker='wrk'                               0.69 %       ±1.27% ±1.69% ±2.20%
http/set_header.js n=1000000 value='Connection'                                                          ***     29.86 %       ±1.13% ±1.51% ±1.96%
http/set_header.js n=1000000 value='Content-Length'                                                      ***     19.09 %       ±0.80% ±1.06% ±1.38%
http/set_header.js n=1000000 value='Content-Type'                                                        ***     29.67 %       ±1.05% ±1.39% ±1.82%
http/set_header.js n=1000000 value='Set-Cookie'                                                          ***     32.43 %       ±1.31% ±1.74% ±2.27%
http/set_header.js n=1000000 value='Transfer-Encoding'                                                   ***     16.99 %       ±0.82% ±1.09% ±1.42%
http/set_header.js n=1000000 value='Vary'                                                                ***     30.43 %       ±1.46% ±1.94% ±2.53%
http/set_header.js n=1000000 value='X-Powered-By'                                                        ***     28.71 %       ±0.90% ±1.19% ±1.55%
http/set-header.js duration=5 res='normal' benchmarker='wrk'                                                      0.55 %       ±1.20% ±1.60% ±2.09%
http/set-header.js duration=5 res='setHeader' benchmarker='wrk'                                           **      1.42 %       ±0.85% ±1.13% ±1.47%
http/set-header.js duration=5 res='setHeaderWH' benchmarker='wrk'                                         **      1.60 %       ±1.04% ±1.38% ±1.79%
http/simple.js duration=5 chunkedEnc=0 c=50 chunks=1 len=1024 type='buffer' benchmarker='wrk'                    -0.27 %       ±1.13% ±1.51% ±1.97%
http/simple.js duration=5 chunkedEnc=0 c=50 chunks=1 len=1024 type='bytes' benchmarker='wrk'                      0.66 %       ±1.00% ±1.34% ±1.74%
http/simple.js duration=5 chunkedEnc=0 c=50 chunks=1 len=102400 type='buffer' benchmarker='wrk'                   1.28 %       ±1.96% ±2.61% ±3.39%
http/simple.js duration=5 chunkedEnc=0 c=50 chunks=1 len=102400 type='bytes' benchmarker='wrk'                    0.61 %       ±1.09% ±1.45% ±1.89%
http/simple.js duration=5 chunkedEnc=0 c=50 chunks=1 len=4 type='buffer' benchmarker='wrk'                       -0.00 %       ±0.84% ±1.11% ±1.45%
http/simple.js duration=5 chunkedEnc=0 c=50 chunks=1 len=4 type='bytes' benchmarker='wrk'                        -0.28 %       ±1.39% ±1.86% ±2.43%
http/simple.js duration=5 chunkedEnc=0 c=50 chunks=4 len=1024 type='buffer' benchmarker='wrk'                     0.81 %       ±1.05% ±1.41% ±1.84%
http/simple.js duration=5 chunkedEnc=0 c=50 chunks=4 len=1024 type='bytes' benchmarker='wrk'                      0.79 %       ±0.97% ±1.30% ±1.69%
http/simple.js duration=5 chunkedEnc=0 c=50 chunks=4 len=102400 type='buffer' benchmarker='wrk'                  -1.43 %       ±1.93% ±2.57% ±3.34%
http/simple.js duration=5 chunkedEnc=0 c=50 chunks=4 len=102400 type='bytes' benchmarker='wrk'                    0.31 %       ±1.85% ±2.46% ±3.20%
http/simple.js duration=5 chunkedEnc=0 c=50 chunks=4 len=4 type='buffer' benchmarker='wrk'                        0.12 %       ±0.71% ±0.95% ±1.24%
http/simple.js duration=5 chunkedEnc=0 c=50 chunks=4 len=4 type='bytes' benchmarker='wrk'                  *      1.05 %       ±0.91% ±1.21% ±1.57%
http/simple.js duration=5 chunkedEnc=0 c=500 chunks=1 len=1024 type='buffer' benchmarker='wrk'            **      1.39 %       ±0.92% ±1.22% ±1.60%
http/simple.js duration=5 chunkedEnc=0 c=500 chunks=1 len=1024 type='bytes' benchmarker='wrk'                     0.08 %       ±1.06% ±1.42% ±1.84%
http/simple.js duration=5 chunkedEnc=0 c=500 chunks=1 len=102400 type='buffer' benchmarker='wrk'                 -0.05 %       ±1.10% ±1.47% ±1.91%
http/simple.js duration=5 chunkedEnc=0 c=500 chunks=1 len=102400 type='bytes' benchmarker='wrk'                   0.30 %       ±0.75% ±0.99% ±1.29%
http/simple.js duration=5 chunkedEnc=0 c=500 chunks=1 len=4 type='buffer' benchmarker='wrk'                *      1.04 %       ±0.98% ±1.30% ±1.69%
http/simple.js duration=5 chunkedEnc=0 c=500 chunks=1 len=4 type='bytes' benchmarker='wrk'                       -0.54 %       ±1.14% ±1.51% ±1.97%
http/simple.js duration=5 chunkedEnc=0 c=500 chunks=4 len=1024 type='buffer' benchmarker='wrk'                    0.40 %       ±1.08% ±1.44% ±1.88%
http/simple.js duration=5 chunkedEnc=0 c=500 chunks=4 len=1024 type='bytes' benchmarker='wrk'                    -0.02 %       ±1.02% ±1.36% ±1.76%
http/simple.js duration=5 chunkedEnc=0 c=500 chunks=4 len=102400 type='buffer' benchmarker='wrk'                  0.08 %       ±1.22% ±1.62% ±2.11%
http/simple.js duration=5 chunkedEnc=0 c=500 chunks=4 len=102400 type='bytes' benchmarker='wrk'                   0.06 %       ±0.88% ±1.17% ±1.52%
http/simple.js duration=5 chunkedEnc=0 c=500 chunks=4 len=4 type='buffer' benchmarker='wrk'                       0.87 %       ±1.06% ±1.41% ±1.84%
http/simple.js duration=5 chunkedEnc=0 c=500 chunks=4 len=4 type='bytes' benchmarker='wrk'                 *      1.00 %       ±0.90% ±1.20% ±1.56%
http/simple.js duration=5 chunkedEnc=1 c=50 chunks=1 len=1024 type='buffer' benchmarker='wrk'                     0.21 %       ±1.39% ±1.86% ±2.42%
http/simple.js duration=5 chunkedEnc=1 c=50 chunks=1 len=1024 type='bytes' benchmarker='wrk'                      0.56 %       ±1.22% ±1.62% ±2.11%
http/simple.js duration=5 chunkedEnc=1 c=50 chunks=1 len=102400 type='buffer' benchmarker='wrk'                   1.29 %       ±1.86% ±2.48% ±3.24%
http/simple.js duration=5 chunkedEnc=1 c=50 chunks=1 len=102400 type='bytes' benchmarker='wrk'                   -0.93 %       ±1.66% ±2.21% ±2.88%
http/simple.js duration=5 chunkedEnc=1 c=50 chunks=1 len=4 type='buffer' benchmarker='wrk'                        0.18 %       ±1.02% ±1.36% ±1.77%
http/simple.js duration=5 chunkedEnc=1 c=50 chunks=1 len=4 type='bytes' benchmarker='wrk'                         0.26 %       ±1.72% ±2.29% ±2.98%
http/simple.js duration=5 chunkedEnc=1 c=50 chunks=4 len=1024 type='buffer' benchmarker='wrk'                    -0.08 %       ±1.16% ±1.54% ±2.00%
http/simple.js duration=5 chunkedEnc=1 c=50 chunks=4 len=1024 type='bytes' benchmarker='wrk'                      0.43 %       ±0.80% ±1.07% ±1.39%
http/simple.js duration=5 chunkedEnc=1 c=50 chunks=4 len=102400 type='buffer' benchmarker='wrk'                   0.03 %       ±1.88% ±2.50% ±3.26%
http/simple.js duration=5 chunkedEnc=1 c=50 chunks=4 len=102400 type='bytes' benchmarker='wrk'             *      1.74 %       ±1.48% ±1.97% ±2.57%
http/simple.js duration=5 chunkedEnc=1 c=50 chunks=4 len=4 type='buffer' benchmarker='wrk'                       -0.02 %       ±1.19% ±1.59% ±2.07%
http/simple.js duration=5 chunkedEnc=1 c=50 chunks=4 len=4 type='bytes' benchmarker='wrk'                         0.63 %       ±0.84% ±1.12% ±1.46%
http/simple.js duration=5 chunkedEnc=1 c=500 chunks=1 len=1024 type='buffer' benchmarker='wrk'                    0.66 %       ±1.16% ±1.54% ±2.01%
http/simple.js duration=5 chunkedEnc=1 c=500 chunks=1 len=1024 type='bytes' benchmarker='wrk'                     0.47 %       ±1.23% ±1.64% ±2.14%
http/simple.js duration=5 chunkedEnc=1 c=500 chunks=1 len=102400 type='buffer' benchmarker='wrk'           *      1.56 %       ±1.23% ±1.63% ±2.12%
http/simple.js duration=5 chunkedEnc=1 c=500 chunks=1 len=102400 type='bytes' benchmarker='wrk'                   0.83 %       ±1.07% ±1.42% ±1.85%
http/simple.js duration=5 chunkedEnc=1 c=500 chunks=1 len=4 type='buffer' benchmarker='wrk'                       0.78 %       ±0.97% ±1.30% ±1.70%
http/simple.js duration=5 chunkedEnc=1 c=500 chunks=1 len=4 type='bytes' benchmarker='wrk'                        0.59 %       ±1.32% ±1.76% ±2.30%
http/simple.js duration=5 chunkedEnc=1 c=500 chunks=4 len=1024 type='buffer' benchmarker='wrk'                    0.78 %       ±0.81% ±1.08% ±1.41%
http/simple.js duration=5 chunkedEnc=1 c=500 chunks=4 len=1024 type='bytes' benchmarker='wrk'                     0.10 %       ±0.99% ±1.32% ±1.72%
http/simple.js duration=5 chunkedEnc=1 c=500 chunks=4 len=102400 type='buffer' benchmarker='wrk'                  0.51 %       ±1.08% ±1.44% ±1.87%
http/simple.js duration=5 chunkedEnc=1 c=500 chunks=4 len=102400 type='bytes' benchmarker='wrk'                   0.50 %       ±0.94% ±1.26% ±1.64%
http/simple.js duration=5 chunkedEnc=1 c=500 chunks=4 len=4 type='buffer' benchmarker='wrk'                *      0.84 %       ±0.76% ±1.01% ±1.32%
http/simple.js duration=5 chunkedEnc=1 c=500 chunks=4 len=4 type='bytes' benchmarker='wrk'                        0.36 %       ±0.88% ±1.18% ±1.53%
http/upgrade.js n=1000                                                                                            0.06 %       ±1.26% ±1.67% ±2.18%
http/upgrade.js n=5                                                                                              -0.28 %       ±2.52% ±3.36% ±4.37%

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 (***)
@mcollina mcollina added the request-ci Add this label to start a Jenkins CI on a PR. label Jul 4, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 4, 2024
@GeoffreyBooth
Copy link
Member

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

So if I’m reading this right, most benchmarks are slightly faster and a few are dramatically faster, almost twice as fast?

If that’s the case then we should remove primordials all across the codebase, especially in hot paths. I think the presumption should be that there needs to be a strong argument for the few places where we wouldn’t remove them.

@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 Jul 5, 2024
@aduh95 aduh95 added the commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. label Jul 5, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 5, 2024
@aduh95 aduh95 added the commit-queue Add this label to land a pull request using GitHub Actions. label Jul 6, 2024
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Jul 6, 2024
@nodejs-github-bot
Copy link
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/53698
✔  Done loading data for nodejs/node/pull/53698
----------------------------------- PR info ------------------------------------
Title      http: remove prototype primordials (#53698)
   ⚠  Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch     aduh95:http-bye-bye-primordials -> nodejs:main
Labels     lib / src, author ready, needs-ci, commit-queue-squash, dont-land-on-v18.x
Commits    3
 - http: remove prototype primordials
 - document areas of the codebase with prototype pollution
 - update linter config
Committers 1
 - Antoine du Hamel 
PR-URL: https://github.com/nodejs/node/pull/53698
Reviewed-By: Yagiz Nizipli 
Reviewed-By: Robert Nagy 
Reviewed-By: Moshe Atlow 
Reviewed-By: Marco Ippolito 
Reviewed-By: Luigi Pinca 
Reviewed-By: Matteo Collina 
Reviewed-By: Benjamin Gruenbaum 
Reviewed-By: James M Snell 
Reviewed-By: Rafael Gonzaga 
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/53698
Reviewed-By: Yagiz Nizipli 
Reviewed-By: Robert Nagy 
Reviewed-By: Moshe Atlow 
Reviewed-By: Marco Ippolito 
Reviewed-By: Luigi Pinca 
Reviewed-By: Matteo Collina 
Reviewed-By: Benjamin Gruenbaum 
Reviewed-By: James M Snell 
Reviewed-By: Rafael Gonzaga 
--------------------------------------------------------------------------------
   ⚠  Commits were pushed since the last approving review:
   ⚠  - http: remove prototype primordials
   ⚠  - document areas of the codebase with prototype pollution
   ⚠  - update linter config
   ℹ  This PR was created on Tue, 02 Jul 2024 17:24:00 GMT
   ✔  Approvals: 9
   ✔  - Yagiz Nizipli (@anonrig): https://github.com/nodejs/node/pull/53698#pullrequestreview-2154462664
   ✔  - Robert Nagy (@ronag) (TSC): https://github.com/nodejs/node/pull/53698#pullrequestreview-2154500028
   ✔  - Moshe Atlow (@MoLow) (TSC): https://github.com/nodejs/node/pull/53698#pullrequestreview-2154501177
   ✔  - Marco Ippolito (@marco-ippolito) (TSC): https://github.com/nodejs/node/pull/53698#pullrequestreview-2154503031
   ✔  - Luigi Pinca (@lpinca): https://github.com/nodejs/node/pull/53698#pullrequestreview-2154520650
   ✔  - Matteo Collina (@mcollina) (TSC): https://github.com/nodejs/node/pull/53698#pullrequestreview-2154573446
   ✔  - Benjamin Gruenbaum (@benjamingr) (TSC): https://github.com/nodejs/node/pull/53698#pullrequestreview-2154632284
   ✔  - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/53698#pullrequestreview-2157912950
   ✔  - Rafael Gonzaga (@RafaelGSS) (TSC): https://github.com/nodejs/node/pull/53698#pullrequestreview-2159299739
   ✔  Last GitHub CI successful
   ℹ  Last Benchmark CI on 2024-07-03T21:54:18Z: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1576/
   ℹ  Last Full PR CI on 2024-07-05T18:46:03Z: https://ci.nodejs.org/job/node-test-pull-request/60102/
- Querying data for job/node-test-pull-request/60102/
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu
https://github.com/nodejs/node/actions/runs/9817906165
@aduh95 aduh95 merged commit cbd2c38 into nodejs:main Jul 6, 2024
63 checks passed
@aduh95
Copy link
Contributor Author

aduh95 commented Jul 6, 2024

Landed in cbd2c38

aduh95 added a commit that referenced this pull request Jul 12, 2024
Co-authored-by: Yagiz Nizipli <yagiz@nizipli.com>
PR-URL: #53698
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
@aduh95 aduh95 mentioned this pull request Jul 12, 2024
aduh95 added a commit that referenced this pull request Jul 16, 2024
Co-authored-by: Yagiz Nizipli <yagiz@nizipli.com>
PR-URL: #53698
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
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-failed An error occurred while landing this pull request using GitHub Actions. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. dont-land-on-v18.x PRs that should not land on the v18.x-staging branch and should not be released in v18.x. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run.