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

perf(ext/streams): optimize streams #20649

Merged
merged 25 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions cli/tests/unit/streams_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,7 @@ function emptyChunkStream() {
});
}

// Try to blow up any recursive reads. Note that because of the use of Array.shift in
// ReadableStream, this might not actually be able to complete with larger values of
// length.
// Try to blow up any recursive reads.
function veryLongTinyPacketStream(length: number) {
return new ReadableStream({
start(controller) {
Expand Down Expand Up @@ -249,9 +247,9 @@ Deno.test(async function readableStreamLongAsyncReadAll() {
});

Deno.test(async function readableStreamVeryLongReadAll() {
const rid = resourceForReadableStream(veryLongTinyPacketStream(10000));
const rid = resourceForReadableStream(veryLongTinyPacketStream(1_000_000));
marcosc90 marked this conversation as resolved.
Show resolved Hide resolved
const buffer = await core.ops.op_read_all(rid);
assertEquals(buffer.length, 10000);
assertEquals(buffer.length, 1_000_000);
core.ops.op_close(rid);
});

Expand Down
Loading