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

enhance(node-fetch): use pipeline from node:streams to pipe streams #1500

Merged
merged 3 commits into from
Jul 26, 2024

Conversation

ardatan
Copy link
Owner

@ardatan ardatan commented Jul 26, 2024

Use suggested `pipeline` from `node:streams` to pipe streams to the final Response object

Copy link
Contributor

github-actions bot commented Jul 26, 2024

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
@whatwg-node/node-fetch 0.5.17-alpha-20240726134117-83e8f8204e0f1386db741961d187a4ea92d82686 npm ↗︎ unpkg ↗︎

Copy link
Contributor

github-actions bot commented Jul 26, 2024

@benchmarks/node-fetch results (noConsumeBody)

   ✓ active_handles.................: avg=139.201483 min=12     med=139     max=200      p(90)=161     p(95)=165    
     data_received..................: 21 MB  700 kB/s
     data_sent......................: 14 MB  454 kB/s
     http_req_blocked...............: avg=2.24µs     min=671ns  med=1.4µs   max=3.61ms   p(90)=2.05µs  p(95)=2.38µs 
     http_req_connecting............: avg=400ns      min=0s     med=0s      max=3.44ms   p(90)=0s      p(95)=0s     
     http_req_duration..............: avg=21.75ms    min=2.95ms med=21.08ms max=995.97ms p(90)=27.61ms p(95)=29.42ms
       { expected_response:true }...: avg=21.75ms    min=2.95ms med=21.08ms max=995.97ms p(90)=27.61ms p(95)=29.42ms
     http_req_failed................: 0.00%  ✓ 0           ✗ 137340
     http_req_receiving.............: avg=39.01µs    min=9.78µs med=26.63µs max=18.76ms  p(90)=41.58µs p(95)=48.82µs
     http_req_sending...............: avg=11.96µs    min=3.57µs med=7.14µs  max=19.18ms  p(90)=10.51µs p(95)=14.5µs 
     http_req_tls_handshaking.......: avg=0s         min=0s     med=0s      max=0s       p(90)=0s      p(95)=0s     
     http_req_waiting...............: avg=21.7ms     min=2.92ms med=21.04ms max=995.91ms p(90)=27.56ms p(95)=29.35ms
     http_reqs......................: 137340 4577.334233/s
     iteration_duration.............: avg=43.64ms    min=9.08ms med=42.37ms max=1.01s    p(90)=47.4ms  p(95)=53.8ms 
     iterations.....................: 68646  2287.867233/s
     vus............................: 50     min=50        max=100 
     vus_max........................: 100    min=100       max=100 

Copy link
Contributor

github-actions bot commented Jul 26, 2024

@benchmarks/node-fetch results (consumeBody)

   ✓ active_handles.................: avg=139.51382 min=52      med=139     max=200      p(90)=162     p(95)=167    
     data_received..................: 21 MB  695 kB/s
     data_sent......................: 13 MB  446 kB/s
     http_req_blocked...............: avg=3.88µs    min=661ns   med=1.2µs   max=5.9ms    p(90)=1.99µs  p(95)=2.24µs 
     http_req_connecting............: avg=2.03µs    min=0s      med=0s      max=5.86ms   p(90)=0s      p(95)=0s     
     http_req_duration..............: avg=21.93ms   min=2.76ms  med=21.42ms max=868.27ms p(90)=27.62ms p(95)=29.19ms
       { expected_response:true }...: avg=21.93ms   min=2.76ms  med=21.42ms max=868.27ms p(90)=27.62ms p(95)=29.19ms
     http_req_failed................: 0.00%  ✓ 0           ✗ 136375
     http_req_receiving.............: avg=33.83µs   min=9.21µs  med=24.33µs max=17.61ms  p(90)=38.27µs p(95)=43.86µs
     http_req_sending...............: avg=11.36µs   min=3.35µs  med=5.83µs  max=33.45ms  p(90)=9.42µs  p(95)=12.52µs
     http_req_tls_handshaking.......: avg=0s        min=0s      med=0s      max=0s       p(90)=0s      p(95)=0s     
     http_req_waiting...............: avg=21.88ms   min=2.71ms  med=21.38ms max=868.19ms p(90)=27.58ms p(95)=29.13ms
     http_reqs......................: 136375 4545.005352/s
     iteration_duration.............: avg=43.96ms   min=13.23ms med=42.75ms max=890.19ms p(90)=47.15ms p(95)=53.07ms
     iterations.....................: 68160  2271.586176/s
     vus............................: 97     min=97        max=100 
     vus_max........................: 100    min=100       max=100 

Copy link
Contributor

github-actions bot commented Jul 26, 2024

@benchmarks/server results (ponyfill)

     ✓ no-errors
     ✓ expected-result

   ✓ checks.........................: 100.00% ✓ 296388      ✗ 0     
     data_received..................: 29 MB   973 kB/s
     data_sent......................: 12 MB   395 kB/s
     http_req_blocked...............: avg=1.41µs   min=922ns    med=1.22µs   max=168.44µs p(90)=1.89µs   p(95)=2.05µs  
     http_req_connecting............: avg=0ns      min=0s       med=0s       max=121.43µs p(90)=0s       p(95)=0s      
     http_req_duration..............: avg=140.41µs min=94.89µs  med=134.98µs max=7.71ms   p(90)=155.99µs p(95)=162.17µs
       { expected_response:true }...: avg=140.41µs min=94.89µs  med=134.98µs max=7.71ms   p(90)=155.99µs p(95)=162.17µs
     http_req_failed................: 0.00%   ✓ 0           ✗ 148194
     http_req_receiving.............: avg=24.67µs  min=12.84µs  med=23.57µs  max=1.88ms   p(90)=30.42µs  p(95)=32.45µs 
     http_req_sending...............: avg=6.28µs   min=4.08µs   med=5.56µs   max=289.37µs p(90)=8.05µs   p(95)=8.59µs  
     http_req_tls_handshaking.......: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting...............: avg=109.45µs min=69.9µs   med=103.49µs max=7.6ms    p(90)=121.69µs p(95)=126.7µs 
     http_reqs......................: 148194  4939.584181/s
     iteration_duration.............: avg=197.98µs min=140.08µs med=191.7µs  max=8.36ms   p(90)=215.73µs p(95)=224.31µs
     iterations.....................: 148194  4939.584181/s
     vus............................: 1       min=1         max=1   
     vus_max........................: 1       min=1         max=1   

Copy link
Contributor

github-actions bot commented Jul 26, 2024

@benchmarks/server results (native)

     ✓ no-errors
     ✓ expected-result

   ✓ checks.........................: 100.00% ✓ 230764      ✗ 0     
     data_received..................: 23 MB   773 kB/s
     data_sent......................: 9.2 MB  308 kB/s
     http_req_blocked...............: avg=1.43µs   min=881ns    med=1.23µs   max=303.96µs p(90)=1.94µs   p(95)=2.12µs  
     http_req_connecting............: avg=1ns      min=0s       med=0s       max=135.22µs p(90)=0s       p(95)=0s      
     http_req_duration..............: avg=198.63µs min=141.56µs med=187.14µs max=13.97ms  p(90)=212.45µs p(95)=221.73µs
       { expected_response:true }...: avg=198.63µs min=141.56µs med=187.14µs max=13.97ms  p(90)=212.45µs p(95)=221.73µs
     http_req_failed................: 0.00%   ✓ 0           ✗ 115382
     http_req_receiving.............: avg=25.56µs  min=13.48µs  med=24.19µs  max=4.86ms   p(90)=31.26µs  p(95)=33.27µs 
     http_req_sending...............: avg=6.37µs   min=4.1µs    med=5.64µs   max=801.91µs p(90)=8.28µs   p(95)=8.87µs  
     http_req_tls_handshaking.......: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting...............: avg=166.68µs min=122.66µs med=154.99µs max=13.88ms  p(90)=177.14µs p(95)=185.73µs
     http_reqs......................: 115382  3845.902485/s
     iteration_duration.............: avg=255.55µs min=184.91µs med=243.36µs max=14.12ms  p(90)=272.56µs p(95)=284.06µs
     iterations.....................: 115382  3845.902485/s
     vus............................: 1       min=1         max=1   
     vus_max........................: 1       min=1         max=1   

@ardatan ardatan merged commit 1f77112 into master Jul 26, 2024
22 checks passed
This was referenced Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant