From c7dd842f84268985e8701c67a9ea2607c13c9ae1 Mon Sep 17 00:00:00 2001 From: Marcos Casagrande Date: Mon, 26 Sep 2022 20:27:50 +0200 Subject: perf(ext/fetch): use content-length in InnerBody.consume (#15925) This fast path prevents repeated allocations when receiving a fetch body with a known size. Co-authored-by: Luca Casonato --- ext/fetch/26_fetch.js | 1 + 1 file changed, 1 insertion(+) (limited to 'ext/fetch/26_fetch.js') diff --git a/ext/fetch/26_fetch.js b/ext/fetch/26_fetch.js index c980bc9b8..13c34f534 100644 --- a/ext/fetch/26_fetch.js +++ b/ext/fetch/26_fetch.js @@ -335,6 +335,7 @@ } else { response.body = new InnerBody( createResponseBodyStream(resp.responseRid, terminator), + resp.contentLength, ); } } -- cgit v1.2.3