Skip to content

Feat/fetch body streams#1382

Draft
richarddavison wants to merge 25 commits intomainfrom
feat/fetch-body-streams
Draft

Feat/fetch body streams#1382
richarddavison wants to merge 25 commits intomainfrom
feat/fetch-body-streams

Conversation

@richarddavison
Copy link
Collaborator

Issue # (if available)

Fixes: #946

Description of changes

Implements full support for web streams in request and response classes for fetch. Performance is also great

Results from benchmarks/fetch-streaming.mjs

Index Payload Chunk LLRT Node.js Bun Winner
0 64KB 4KB 2.24ms 28MB/s 13.21ms 5MB/s 3.99ms 16MB/s LLRT
1 64KB 16KB 0.81ms 77MB/s 13.02ms 5MB/s 4.01ms 16MB/s LLRT
2 64KB 64KB 0.78ms 80MB/s 12.85ms 5MB/s 3.95ms 16MB/s LLRT
3 64KB 256KB 0.96ms 65MB/s 13.04ms 5MB/s 3.94ms 16MB/s LLRT
4 64KB 1MB 1.16ms 54MB/s 13.34ms 5MB/s 4.31ms 15MB/s LLRT
5 64KB 4MB 2.47ms 25MB/s 14.89ms 4MB/s 5.97ms 10MB/s LLRT
6 256KB 4KB 1.08ms 231MB/s 14.08ms 18MB/s 4.23ms 59MB/s LLRT
7 256KB 16KB 0.91ms 276MB/s 13.92ms 18MB/s 4.25ms 59MB/s LLRT
8 256KB 64KB 0.80ms 313MB/s 13.57ms 18MB/s 3.97ms 63MB/s LLRT
9 256KB 256KB 0.80ms 314MB/s 13.41ms 19MB/s 4.12ms 61MB/s LLRT
10 256KB 1MB 1.30ms 192MB/s 13.96ms 18MB/s 4.59ms 54MB/s LLRT
11 256KB 4MB 2.72ms 92MB/s 14.41ms 17MB/s 5.80ms 43MB/s LLRT
12 1MB 4KB 2.81ms 356MB/s 17.28ms 58MB/s 5.45ms 184MB/s LLRT
13 1MB 16KB 1.76ms 568MB/s 16.19ms 62MB/s 5.08ms 197MB/s LLRT
14 1MB 64KB 1.34ms 746MB/s 15.53ms 64MB/s 5.02ms 199MB/s LLRT
15 1MB 256KB 1.44ms 693MB/s 15.21ms 66MB/s 4.97ms 201MB/s LLRT
16 1MB 1MB 1.91ms 523MB/s 15.88ms 63MB/s 5.67ms 176MB/s LLRT
17 1MB 4MB 3.83ms 261MB/s 15.99ms 63MB/s 7.53ms 133MB/s LLRT
18 4MB 4KB 19.62ms 204MB/s 24.16ms 166MB/s 8.15ms 491MB/s Bun
19 4MB 16KB 4.21ms 950MB/s 22.26ms 180MB/s 7.06ms 566MB/s LLRT
20 4MB 64KB 3.70ms 1082MB/s 22.36ms 179MB/s 7.84ms 510MB/s LLRT
21 4MB 256KB 2.57ms 1554MB/s 21.67ms 185MB/s 7.78ms 514MB/s LLRT
22 4MB 1MB 3.37ms 1186MB/s 21.48ms 186MB/s 6.74ms 593MB/s LLRT
23 4MB 4MB 3.94ms 1016MB/s 22.91ms 175MB/s 9.22ms 434MB/s LLRT
24 16MB 4KB 37.44ms 427MB/s 50.21ms 319MB/s 23.29ms 687MB/s Bun
25 16MB 16KB 14.36ms 1114MB/s 41.33ms 387MB/s 20.37ms 785MB/s LLRT
26 16MB 64KB 6.17ms 2593MB/s 36.14ms 443MB/s 16.80ms 953MB/s LLRT
27 16MB 256KB 5.65ms 2832MB/s 33.30ms 480MB/s 15.26ms 1048MB/s LLRT
28 16MB 1MB 4.45ms 3596MB/s 33.03ms 484MB/s 17.90ms 894MB/s LLRT
29 16MB 4MB 5.83ms 2744MB/s 34.64ms 462MB/s 19.72ms 811MB/s LLRT
30 64MB 4KB 244.76ms 261MB/s 113.66ms 563MB/s 69.96ms 915MB/s Bun
31 64MB 16KB 59.25ms 1080MB/s 127.62ms 501MB/s 84.22ms 760MB/s LLRT
32 64MB 64KB 23.73ms 2697MB/s 79.65ms 803MB/s 54.22ms 1180MB/s LLRT
33 64MB 256KB 17.24ms 3711MB/s 71.48ms 895MB/s 47.35ms 1352MB/s LLRT
34 64MB 1MB 15.38ms 4161MB/s 62.80ms 1019MB/s 46.46ms 1378MB/s LLRT
35 64MB 4MB 16.69ms 3835MB/s 62.10ms 1031MB/s 55.63ms 1150MB/s LLRT
36 256MB 4KB 1184.10ms 216MB/s 435.41ms 588MB/s 302.01ms 848MB/s Bun
37 256MB 16KB 471.99ms 542MB/s 434.21ms 590MB/s 249.37ms 1027MB/s Bun
38 256MB 64KB 231.68ms 1105MB/s 261.92ms 977MB/s 131.23ms 1951MB/s Bun
39 256MB 256KB 66.14ms 3871MB/s 240.28ms 1065MB/s 142.39ms 1798MB/s LLRT
40 256MB 1MB 65.41ms 3914MB/s 199.39ms 1284MB/s 139.70ms 1832MB/s LLRT
41 256MB 4MB 60.29ms 4246MB/s 217.90ms 1175MB/s 137.57ms 1861MB/s LLRT
42 1GB 4KB 5693.05ms 180MB/s 1648.20ms 621MB/s 825.76ms 1240MB/s Bun
43 1GB 16KB 2573.60ms 398MB/s 1791.16ms 572MB/s 1078.10ms 950MB/s Bun
44 1GB 64KB 903.12ms 1134MB/s 617.58ms 1658MB/s 905.07ms 1131MB/s Node.js
45 1GB 256KB 320.77ms 3192MB/s 736.46ms 1390MB/s 831.24ms 1232MB/s LLRT
46 1GB 1MB 361.12ms 2836MB/s 772.28ms 1326MB/s 435.68ms 2350MB/s LLRT
47 1GB 4MB 351.86ms 2910MB/s 707.48ms 1447MB/s 532.08ms 1925MB/s LLRT

Checklist

  • Created unit tests in tests/unit and/or in Rust for my feature if needed
  • Ran make fix to format JS and apply Clippy auto fixes
  • Made sure my code didn't add any additional warnings: make check
  • Added relevant type info in types/ directory
  • Updated documentation if needed (API.md/README.md/Other)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@richarddavison richarddavison force-pushed the feat/fetch-body-streams branch from a3793ae to ac77021 Compare February 18, 2026 13:23
@nabetti1720
Copy link
Contributor

nabetti1720 commented Feb 19, 2026

I think it might work with the same feature name if you move modules/llrt_fetch/src/decompress.rs into llrt_compression and expose it from there. By doing so, I think the Cargo.toml dependencies for llrt_fetch will be a little simpler

@richarddavison richarddavison force-pushed the feat/fetch-body-streams branch from 58a8e00 to 612b08b Compare February 19, 2026 14:29
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.

Fetch does not support webstreams

2 participants