Skip to content

http: reduce multiple output arrays into one

Now we are using output, outputEncodings and outputCallbacks to hold pending data. Reducing them into one array outputData can slightly improve performance and reduce some redundant codes.

Here is the benchmark for client request:

 http/create-clientrequest.js e=1 arg='options' url='idn'                           ***      2.72 %      ±0.93% ±1.23% ±1.61%
 http/create-clientrequest.js e=1 arg='options' url='long'                          ***      1.91 %      ±1.07% ±1.42% ±1.85%
 http/create-clientrequest.js e=1 arg='options' url='wpt'                           ***      2.61 %      ±1.33% ±1.77% ±2.30%
 http/create-clientrequest.js e=1 arg='string' url='idn'                              *      0.79 %      ±0.69% ±0.92% ±1.20%
 http/create-clientrequest.js e=1 arg='string' url='long'                                    0.54 %      ±0.69% ±0.92% ±1.21%
 http/create-clientrequest.js e=1 arg='string' url='wpt'                              *      0.83 %      ±0.79% ±1.05% ±1.37%
 http/create-clientrequest.js e=1 arg='URL' url='idn'                                        0.72 %      ±0.77% ±1.02% ±1.33%
 http/create-clientrequest.js e=1 arg='URL' url='long'                              ***      1.36 %      ±0.62% ±0.82% ±1.07%
 http/create-clientrequest.js e=1 arg='URL' url='wpt'                                 *      1.18 %      ±0.99% ±1.32% ±1.72%
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

Merge request reports

Loading