mirror of
https://github.com/denoland/deno.git
synced 2024-12-26 00:59:24 -05:00
23ff0e722e
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_infra.js | ||
01_dom_exception.js | ||
01_mimesniff.js | ||
02_event.js | ||
02_structured_clone.js | ||
02_timers.js | ||
03_abort_signal.js | ||
04_global_interfaces.js | ||
05_base64.js | ||
06_streams.js | ||
06_streams_types.d.ts | ||
08_text_encoding.js | ||
09_file.js | ||
10_filereader.js | ||
12_location.js | ||
13_message_port.js | ||
14_compression.js | ||
15_performance.js | ||
blob.rs | ||
Cargo.toml | ||
compression.rs | ||
hr_timer_lock.rs | ||
internal.d.ts | ||
lib.deno_web.d.ts | ||
lib.rs | ||
message_port.rs | ||
README.md | ||
stream_resource.rs | ||
timers.rs |
deno web
Op crate that implements Event, TextEncoder, TextDecoder and File API (https://w3c.github.io/FileAPI).
Testing for text encoding is done via WPT in cli/.