1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-22 15:06:54 -05:00
denoland-deno/ext
Matt Mastracci 23ff0e722e
feat(ext/web): resourceForReadableStream (#20180)
Extracted from fast streams work.

This is a resource wrapper for `ReadableStream`, allowing us to treat
all `ReadableStream` instances as resources, and remove special paths in
both `fetch` and `serve`.

Performance with a ReadableStream response yields ~18% improvement:

```
  return new Response(new ReadableStream({
    start(controller) {
      controller.enqueue(new Uint8Array([104, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100]));
      controller.close();
    }
  })
```

This patch:

```
12:36 $ third_party/prebuilt/mac/wrk http://localhost:8080
Running 10s test @ http://localhost:8080
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    99.96us  100.03us   6.65ms   98.84%
    Req/Sec    47.73k     2.43k   51.02k    89.11%
  959308 requests in 10.10s, 117.10MB read
Requests/sec:  94978.71
Transfer/sec:     11.59MB
```

main:

```
Running 10s test @ http://localhost:8080
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   163.03us  685.51us  19.73ms   99.27%
    Req/Sec    39.50k     3.98k   66.11k    95.52%
  789582 requests in 10.10s, 82.83MB read
Requests/sec:  78182.65
Transfer/sec:      8.20MB
```
2023-08-17 07:52:37 -06:00
..
broadcast_channel chore: forward v1.36.1 to main (#20119) 2023-08-10 16:44:41 +03:00
cache chore: forward v1.36.1 to main (#20119) 2023-08-10 16:44:41 +03:00
console chore: forward v1.36.1 to main (#20119) 2023-08-10 16:44:41 +03:00
crypto chore: forward v1.36.1 to main (#20119) 2023-08-10 16:44:41 +03:00
fetch fix: release ReadeableStream in fetch (#17365) 2023-08-16 14:02:15 +02:00
ffi chore: forward v1.36.1 to main (#20119) 2023-08-10 16:44:41 +03:00
fs chore: forward v1.36.1 to main (#20119) 2023-08-10 16:44:41 +03:00
http feat(ext/web): resourceForReadableStream (#20180) 2023-08-17 07:52:37 -06:00
io chore: deno_core -> 0.201.0 (#20135) 2023-08-12 19:04:45 +00:00
kv fix(ext/kv): retry transaction on SQLITE_BUSY errors (#20189) 2023-08-17 18:53:55 +08:00
napi chore: forward v1.36.1 to main (#20119) 2023-08-10 16:44:41 +03:00
net fix(ext/net): implement a graceful error on an invalid SSL certificate (#20157) 2023-08-15 00:11:12 +00:00
node fix(ext/node): allow for the reassignment of userInfo() on Windows (#20165) 2023-08-16 11:28:49 +02:00
tls chore: forward v1.36.1 to main (#20119) 2023-08-10 16:44:41 +03:00
url perf(ext/urlpattern): optimize URLPattern.exec (#20170) 2023-08-16 12:58:03 +02:00
web feat(ext/web): resourceForReadableStream (#20180) 2023-08-17 07:52:37 -06:00
webidl chore: forward v1.36.1 to main (#20119) 2023-08-10 16:44:41 +03:00
websocket chore: forward v1.36.1 to main (#20119) 2023-08-10 16:44:41 +03:00
webstorage chore: forward v1.36.1 to main (#20119) 2023-08-10 16:44:41 +03:00