summaryrefslogtreecommitdiff
path: root/ext/fetch
diff options
context:
space:
mode:
authorLuca Casonato <hello@lcas.dev>2023-09-16 07:48:31 +0200
committerGitHub <noreply@github.com>2023-09-16 07:48:31 +0200
commit430b63c2c4d6567a77e77980058ef13b45a9f30e (patch)
tree714fef4813a5614ccdd17b681f30e3bd0b4057bd /ext/fetch
parentbf0760411336ce5ebb1c103f766c8154af478414 (diff)
perf: improve async op santizer speed and accuracy (#20501)
This commit improves async op sanitizer speed by only delaying metrics collection if there are pending ops. This results in a speedup of around 30% for small CPU bound unit tests. It performs this check and possible delay on every collection now, fixing an issue with parent test leaks into steps.
Diffstat (limited to 'ext/fetch')
-rw-r--r--ext/fetch/26_fetch.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/fetch/26_fetch.js b/ext/fetch/26_fetch.js
index 311a197a8..f1c771dc0 100644
--- a/ext/fetch/26_fetch.js
+++ b/ext/fetch/26_fetch.js
@@ -284,6 +284,9 @@ async function mainFetch(req, recursive, terminator) {
cause: requestSendError,
});
}
+ if (requestBodyRid !== null) {
+ core.tryClose(requestBodyRid);
+ }
throw err;
} finally {
if (cancelHandleRid !== null) {