From 9167f0c6bda44846a9c54712ae64d05383bdfc3e Mon Sep 17 00:00:00 2001 From: Aaron O'Mullan Date: Mon, 27 Sep 2021 13:19:24 +0200 Subject: perf(fetch): optimize newInnerRequest blob url check (#12245) Avoid "blob:" prefix check on requests built in the http module since those can never be blob objects Reduces cost of `newInnerRequest()` from 20ms to 0.1ms in my profiled run on ~2.5M reqs --- ext/http/01_http.js | 1 + 1 file changed, 1 insertion(+) (limited to 'ext/http/01_http.js') diff --git a/ext/http/01_http.js b/ext/http/01_http.js index 723293689..2681edff8 100644 --- a/ext/http/01_http.js +++ b/ext/http/01_http.js @@ -103,6 +103,7 @@ url, headersList, body !== null ? new InnerBody(body) : null, + false, ); const signal = abortSignal.newSignal(); const request = fromInnerRequest(innerRequest, signal, "immutable"); -- cgit v1.2.3