diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2023-02-24 01:20:15 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-23 19:50:15 +0000 |
commit | da781280b8422b4116473b366fb7d207909a31da (patch) | |
tree | bef59ac9dd8e26d97d7d494de87d53ab537724cc /core/examples | |
parent | 4773d07974167b565ba84d5603a6d6f70cd12660 (diff) |
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.
Diffstat (limited to 'core/examples')
-rw-r--r-- | core/examples/http_bench_json_ops/http_bench_json_ops.js | 7 |
1 files changed, 3 insertions, 4 deletions
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) { |