mirror of
https://github.com/denoland/deno.git
synced 2024-11-25 15:29:32 -05:00
32947e5ea5
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 ``` |
||
---|---|---|
.. | ||
benches | ||
00_serve.js | ||
01_http.js | ||
Cargo.toml | ||
compressible.rs | ||
http_next.rs | ||
hyper_util_tokioio.rs | ||
lib.rs | ||
network_buffered_stream.rs | ||
reader_stream.rs | ||
README.md | ||
request_body.rs | ||
request_properties.rs | ||
response_body.rs | ||
slab.rs | ||
websocket_upgrade.rs |