From c36d9129b5995d3656e878ff94c8bd2fe7d17b05 Mon Sep 17 00:00:00 2001 From: Matt Mastracci Date: Thu, 4 Jan 2024 11:53:04 -0700 Subject: chore(cli): bump deno_core (#21790) --- cli/bench/deno_common.js | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'cli/bench/deno_common.js') diff --git a/cli/bench/deno_common.js b/cli/bench/deno_common.js index b10b1e7a7..b4319c8a3 100644 --- a/cli/bench/deno_common.js +++ b/cli/bench/deno_common.js @@ -5,34 +5,32 @@ Deno.bench("date_now", { n: 5e5 }, () => { Date.now(); }); +const { op_void_sync, op_void_async, op_add } = Deno[Deno.internal].core + .ensureFastOps(); + // Fast API calls { - const { op_add } = Deno[Deno.internal].core.ops; - // deno-lint-ignore no-inner-declarations - function add(a, b) { - return op_add(a, b); - } // deno-lint-ignore no-inner-declarations function addJS(a, b) { return a + b; } - Deno.bench("op_add", () => add(1, 2)); + Deno.bench("op_add", () => op_add(1, 2)); Deno.bench("add_js", () => addJS(1, 2)); } -const { op_void_sync } = Deno[Deno.internal].core.ops; -function sync() { - return op_void_sync(); -} -sync(); // Warmup - // Void ops measure op-overhead -Deno.bench("op_void_sync", () => sync()); +Deno.bench("op_void_sync", () => op_void_sync()); Deno.bench( "op_void_async", { n: 1e6 }, - () => Deno[Deno.internal].core.opAsync("op_void_async"), + () => op_void_async(), +); + +Deno.bench( + "op_void_await_async", + { n: 1e6 }, + async () => await op_void_async(), ); // A very lightweight op, that should be highly optimizable -- cgit v1.2.3