summaryrefslogtreecommitdiff
path: root/cli/bench
diff options
context:
space:
mode:
authorMatt Mastracci <matthew@mastracci.com>2024-01-04 11:53:04 -0700
committerGitHub <noreply@github.com>2024-01-04 18:53:04 +0000
commitc36d9129b5995d3656e878ff94c8bd2fe7d17b05 (patch)
treebf76312e7e2c8143ca20741e84ffec0de09378bc /cli/bench
parent0245ac08d419d462ba7cf9dd4153fcea9a30e843 (diff)
chore(cli): bump deno_core (#21790)
Diffstat (limited to 'cli/bench')
-rw-r--r--cli/bench/deno_common.js26
1 files changed, 12 insertions, 14 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