1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00
denoland-deno/ext/web
Matt Mastracci 0981aefbdc
fix(ext/web): Aggregate small packets for Resource implementation of ReadableStream (#20570)
Fixes: #20569 by introducing a custom replacement for the tokio mpsc
channel that is byte-size backpressure-aware.

Using the testcase in the linked bug, we see all the small writes
aggregated into a single packet and HTTP frame.

```
10:39 $ nc localhost 8000
GET / HTTP/1.1

HTTP/1.1 200 OK
content-type: text/plain
vary: Accept-Encoding
transfer-encoding: chunked
date: Tue, 19 Sep 2023 16:39:13 GMT

A
0
1
2
3
4
```

This patch:

```
Running 10s test @ http://localhost:8080/
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   157.47us  194.89us   9.53ms   98.97%
    Req/Sec    31.37k     1.56k   34.73k    85.15%
  630407 requests in 10.10s, 73.35MB read
Requests/sec:  62428.12
Transfer/sec:      7.26MB
```

main:

```
Running 10s test @ http://localhost:8080/
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   343.75us  200.48us  10.41ms   98.25%
    Req/Sec    14.64k   806.52    16.98k    84.65%
  294018 requests in 10.10s, 39.82MB read
Requests/sec:  29109.91
Transfer/sec:      3.94MB
```

---------

Co-authored-by: Bert Belder <bertbelder@gmail.com>
2023-09-20 11:23:58 -06:00
..
benches refactor: update core extension api usage (#19952) 2023-07-31 18:19:15 +00:00
00_infra.js fix(core): Use safe primordials wrappers (#18687) 2023-04-14 22:23:28 +02:00
01_dom_exception.js refactor(webidl): move prefix & context out of converters options bag (#18931) 2023-05-01 10:47:13 +00:00
01_mimesniff.js perf: optimize RegExp usage in JS (#19364) 2023-06-05 10:52:40 +02:00
02_event.js perf(ext/event): always set timeStamp to 0 (#20191) 2023-08-20 10:02:47 +00:00
02_structured_clone.js fix(core): Use safe primordials wrappers (#18687) 2023-04-14 22:23:28 +02:00
02_timers.js feat: support import attributes (#20342) 2023-09-07 09:09:16 -04:00
03_abort_signal.js fix(ext/abort): trigger AbortSignal events in correct order (#20095) 2023-08-08 12:05:42 +02:00
04_global_interfaces.js refactor: rename InternalModuleLoader to ExtModuleLoader, use ext: scheme for snapshotted modules (#18041) 2023-03-08 12:44:54 +01:00
05_base64.js refactor(webidl): move prefix & context out of converters options bag (#18931) 2023-05-01 10:47:13 +00:00
06_streams.js perf(ext/streams): optimize async iterator (#20541) 2023-09-17 15:54:40 +00:00
06_streams_types.d.ts chore: update copyright year to 2023 (#17247) 2023-01-02 21:00:42 +00:00
08_text_encoding.js refactor(webidl): move prefix & context out of converters options bag (#18931) 2023-05-01 10:47:13 +00:00
09_file.js feat(ext/web): Add name to Deno.customInspect of File objects (#20415) 2023-09-14 07:06:58 +02:00
10_filereader.js refactor(webidl): move prefix & context out of converters options bag (#18931) 2023-05-01 10:47:13 +00:00
12_location.js chore: fix typos (#19572) 2023-06-26 09:10:27 -04:00
13_message_port.js fix: call setIsTrusted for generated events (MessageEvent) (#19919) 2023-07-31 23:22:07 +02:00
14_compression.js refactor(webidl): move prefix & context out of converters options bag (#18931) 2023-05-01 10:47:13 +00:00
15_performance.js refactor(webidl): move prefix & context out of converters options bag (#18931) 2023-05-01 10:47:13 +00:00
blob.rs Reland "fix(cli): don't store blob and data urls in the module cache" (#18581) 2023-07-02 00:52:30 +02:00
Cargo.toml 1.37.0 (#20574) 2023-09-19 20:29:17 +00:00
compression.rs fix(ext/compression): throw TypeError on corrupt input (#19979) 2023-07-30 09:15:29 -04:00
hr_timer_lock.rs chore: update to Rust 1.71 (#19822) 2023-07-13 15:16:24 -06:00
internal.d.ts perf(ext/node): Optimise Buffer string operations (#20158) 2023-09-07 14:41:16 -06:00
lib.deno_web.d.ts fix(dts): make globals available on globalThis (#19438) 2023-07-03 14:36:55 -04:00
lib.rs feat(ext/web): resourceForReadableStream (#20180) 2023-08-17 07:52:37 -06:00
message_port.rs refactor: rewrite more ops to op2 macro (#20478) 2023-09-14 23:05:18 +02:00
README.md Rename extensions/ directory to ext/ (#11643) 2021-08-11 12:27:05 +02:00
stream_resource.rs fix(ext/web): Aggregate small packets for Resource implementation of ReadableStream (#20570) 2023-09-20 11:23:58 -06:00
timers.rs Revert "refactor: rewrite ops that use 'deferred' to use 'op2(async(lazy))' (#20303) (#20370) 2023-09-04 17:05:06 -04:00

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/.