aboutsummaryrefslogtreecommitdiff
path: root/bench/snippets/noop.js
blob: d4fc03680e6aa6aa5099881a99c0572332346f5d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { bench, run } from "mitata";

var noop = globalThis[Symbol.for("Bun.lazy")]("noop");
var { function: noopFn, callback } = noop;
const noop2 = () => {};

bench("function", function () {
  noopFn();
});

bench("JSC::call(() => {})", () => {
  callback(noop2);
});

const bound = noop2.bind(null);
bench("bound call", () => {
  bound();
});

bench("setter", function () {
  noop.getterSetter = 1;
});

bench("getter", function () {
  noop.getterSetter;
});

run();