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

Optimize ReadableStream backed by non-BYOB readables #16222

Open
lucacasonato opened this issue Oct 9, 2022 · 0 comments
Open

Optimize ReadableStream backed by non-BYOB readables #16222

lucacasonato opened this issue Oct 9, 2022 · 0 comments
Labels
deno_core Changes in "deno_core" crate are needed perf performance related

Comments

@lucacasonato
Copy link
Member

#16115 changed deno_core::Resource to have seperate read methods for BYOB optimized resources (files & sockets) and non-BYOB optimized resources (HTTP steams).

Currently the only way to read data from Rust -> JS is via the op_read op. This op is BYOB, and can incur an extra data copy & allocation for non-BYOB ops. I propose we rename op_read to op_read_byob and add a new op_read_buf that is not BYOB. We can then add a second readableStreamForRid function for non-BYOB optimized resources. These ReadableStream's can use op_read_buf internally to avoid a bunch of small data copies, maybe even some data copies.

@lucacasonato lucacasonato added perf performance related deno_core Changes in "deno_core" crate are needed labels Oct 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deno_core Changes in "deno_core" crate are needed perf performance related
Projects
None yet
Development

No branches or pull requests

1 participant