diff options
author | Marcos Casagrande <marcoscvp90@gmail.com> | 2022-09-26 20:27:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-26 20:27:50 +0200 |
commit | c7dd842f84268985e8701c67a9ea2607c13c9ae1 (patch) | |
tree | 88b55ac6880a539b3f6f8342c388eff6d5cc79ce /ext/fetch/26_fetch.js | |
parent | 1628dba6db3f9cd5d9730a95f5c06573f66361ca (diff) |
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 <hello@lcas.dev>
Diffstat (limited to 'ext/fetch/26_fetch.js')
-rw-r--r-- | ext/fetch/26_fetch.js | 1 |
1 files changed, 1 insertions, 0 deletions
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, ); } } |