From 94abc87d6ec33af2a2c781314abc49efc5c1db99 Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Sun, 26 Feb 2023 00:50:56 -0800 Subject: Add callback to bench --- bench/snippets/noop.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'bench/snippets') diff --git a/bench/snippets/noop.js b/bench/snippets/noop.js index 789e6abbb..d4fc03680 100644 --- a/bench/snippets/noop.js +++ b/bench/snippets/noop.js @@ -1,9 +1,20 @@ import { bench, run } from "mitata"; var noop = globalThis[Symbol.for("Bun.lazy")]("noop"); +var { function: noopFn, callback } = noop; +const noop2 = () => {}; bench("function", function () { - noop.function(); + noopFn(); +}); + +bench("JSC::call(() => {})", () => { + callback(noop2); +}); + +const bound = noop2.bind(null); +bench("bound call", () => { + bound(); }); bench("setter", function () { -- cgit v1.2.3