diff options
Diffstat (limited to 'cli')
-rw-r--r-- | cli/bench/deno_common.js | 26 | ||||
-rw-r--r-- | cli/tests/testdata/run/ffi/unstable_ffi_3.js | 4 |
2 files changed, 15 insertions, 15 deletions
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 diff --git a/cli/tests/testdata/run/ffi/unstable_ffi_3.js b/cli/tests/testdata/run/ffi/unstable_ffi_3.js index b59a264ea..075fb3a54 100644 --- a/cli/tests/testdata/run/ffi/unstable_ffi_3.js +++ b/cli/tests/testdata/run/ffi/unstable_ffi_3.js @@ -1,4 +1,6 @@ -Deno[Deno.internal].core.opAsync("op_ffi_call_ptr_nonblocking", null, { +const { op_ffi_call_ptr_nonblocking } = Deno[Deno.internal].core + .ensureFastOps(); +op_ffi_call_ptr_nonblocking(null, { name: null, parameters: [], result: "void", |