Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ext/web): use readableStreamDefaultReaderRead in resourceForReadableStream #20622

Merged
merged 6 commits into from Sep 23, 2023

Conversation

mmastrac
Copy link
Member

@mmastrac mmastrac commented Sep 21, 2023

We can go one level down in abstraction and avoid using the public ReadableStream APIs.

This patch ~5% perf boost on small ReadableStream:

Running 10s test @ http://localhost:8080/
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   148.32us  108.95us   3.88ms   95.71%
    Req/Sec    33.24k     2.68k   37.94k    73.76%
  668188 requests in 10.10s, 77.74MB read
Requests/sec:  66162.91
Transfer/sec:      7.70MB

main:

Running 10s test @ http://localhost:8080/
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   150.23us   67.61us   4.39ms   94.80%
    Req/Sec    31.81k     1.55k   35.56k    83.17%
  639078 requests in 10.10s, 74.36MB read
Requests/sec:  63273.72
Transfer/sec:      7.36MB

ext/web/06_streams.js Outdated Show resolved Hide resolved
cli/tests/unit/streams_test.ts Show resolved Hide resolved
ext/web/stream_resource.rs Outdated Show resolved Hide resolved
cli/tests/unit/streams_test.ts Show resolved Hide resolved
cli/tests/unit/streams_test.ts Show resolved Hide resolved
Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mmastrac mmastrac merged commit 06297d9 into denoland:main Sep 23, 2023
13 checks passed
mmastrac added a commit that referenced this pull request Sep 25, 2023
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.

None yet

3 participants