From da781280b8422b4116473b366fb7d207909a31da Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Fri, 24 Feb 2023 01:20:15 +0530 Subject: fix(core): remove async op inlining optimization (#17899) Runtime generation of async op wrappers contributed to increased startup time and core became unusable with `--disallow-code-generation-from-strings` flag. The optimization only affects very small microbenchmarks so this revert will not cause any regressions. --- core/examples/http_bench_json_ops/http_bench_json_ops.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'core/examples') diff --git a/core/examples/http_bench_json_ops/http_bench_json_ops.js b/core/examples/http_bench_json_ops/http_bench_json_ops.js index 9650804c7..5a205188b 100644 --- a/core/examples/http_bench_json_ops/http_bench_json_ops.js +++ b/core/examples/http_bench_json_ops/http_bench_json_ops.js @@ -2,9 +2,8 @@ // This is not a real HTTP server. We read blindly one time into 'requestBuf', // then write this fixed 'responseBuf'. The point of this benchmark is to // exercise the event loop in a simple yet semi-realistic way. -Deno.core.initializeAsyncOps(); -const { ops } = Deno.core; +const { ops, opAsync } = Deno.core; const requestBuf = new Uint8Array(64 * 1024); const responseBuf = new Uint8Array( @@ -20,11 +19,11 @@ function listen() { /** Accepts a connection, returns rid. */ function accept(serverRid) { - return ops.op_accept(serverRid); + return opAsync("op_accept", serverRid); } function read(serverRid, buf) { - return ops.op_read_socket(serverRid, buf); + return opAsync("op_read_socket", serverRid, buf); } async function serve(rid) { -- cgit v1.2.3