From cb2ca234bb39d8e02b08d2866860e8d3a00b5887 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Fri, 14 Apr 2023 02:41:32 +0200 Subject: refactor(core): limit number of boundary crossings between Rust and V8 (#18652) This commit refactors "deno_core" to do fewer boundary crossings from Rust to V8. In other words we are now calling V8 from Rust fewer times. This is done by merging 3 distinct callbacks into a single one. Instead of having "op resolve" callback, "next tick" callback and "macrotask queue" callback, we now have only "Deno.core.eventLoopTick" callback, which is responsible for doing the same actions previous 3 callbacks. On each of the event loop we were doing at least 2 boundary crosses (timers macrotask queue callback and unhandled promise rejection callback) and up to 4 crosses if there were op response and next tick callbacks coming from Node.js compatibility layer. Now this is all done in a single callback. Closes https://github.com/denoland/deno/issues/18620 --- cli/tests/testdata/workers/worker_async_error.ts.out | 1 + 1 file changed, 1 insertion(+) (limited to 'cli/tests/testdata/workers/worker_async_error.ts.out') diff --git a/cli/tests/testdata/workers/worker_async_error.ts.out b/cli/tests/testdata/workers/worker_async_error.ts.out index 16f6a6b84..84863f016 100644 --- a/cli/tests/testdata/workers/worker_async_error.ts.out +++ b/cli/tests/testdata/workers/worker_async_error.ts.out @@ -5,3 +5,4 @@ error: Uncaught (in worker "foo") (in promise) Error: bar at [WILDCARD]/async_error.ts:[WILDCARD] error: Uncaught (in promise) Error: Unhandled error in child worker. at Worker.#pollControl ([WILDCARD]) + at eventLoopTick (ext:core/01_core.js:[WILDCARD]) -- cgit v1.2.3