From 0efe438f7c191d8504355e03b27fe7e3055c9387 Mon Sep 17 00:00:00 2001 From: Matt Mastracci Date: Tue, 26 Dec 2023 18:30:26 -0700 Subject: perf: remove opAsync (#21690) `opAsync` requires a lookup by name on each async call. This is a mechanical translation of all opAsync calls to ensureFastOps. The `opAsync` API on Deno.core will be removed at a later time. --- ext/web/06_streams.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'ext/web/06_streams.js') diff --git a/ext/web/06_streams.js b/ext/web/06_streams.js index 988f1d990..31f0f2862 100644 --- a/ext/web/06_streams.js +++ b/ext/web/06_streams.js @@ -19,6 +19,11 @@ const { op_readable_stream_resource_close, op_readable_stream_resource_await_close, } = core.ensureFastOps(); +// TODO(mmastrac): use readAll +const { + op_read_all, +} = core.ensureFastOps(true); + import * as webidl from "ext:deno_webidl/00_webidl.js"; import { structuredClone } from "ext:deno_web/02_structured_clone.js"; import { @@ -1065,7 +1070,7 @@ async function readableStreamCollectIntoUint8Array(stream) { // fast path, read whole body in a single op call try { readableStreamDisturb(stream); - const promise = core.opAsync("op_read_all", resourceBacking.rid); + const promise = op_read_all(resourceBacking.rid); if (readableStreamIsUnrefable(stream)) { stream[promiseSymbol] = promise; if (stream[_isUnref]) core.unrefOpPromise(promise); -- cgit v1.2.3