aboutsummaryrefslogtreecommitdiff
path: root/bench/snippets/native-overhead.mjs
blob: f1c0e24adb20000eb26287091258ccb9b21a756d (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
import { bench, run } from "./runner.mjs";

// These are no-op C++ functions that are exported to JS.
const lazy = globalThis[Symbol.for("Bun.lazy")];
const noop = lazy("noop");
const fn = noop.function;
const regular = noop.functionRegular;

bench("C++ fn regular", () => {
  regular();
});

bench("C++ fn", () => {
  fn();
});

bench("C++ getter", () => {
  return noop.getterSetter;
});

bench("C++ setter", () => {
  noop.getterSetter = 1;
});

run();
7d67a2df6fd2b8c1db973a3?s=13&d=retro' width='13' height='13' alt='Gravatar' /> Snazzah 1-0/+1 2022-07-09feat(landing): remove space between zig and "'s"Gravatar Snazzah 1-1/+1 2022-07-09feat(landing): add SVG logo, manifest, and meta tagsGravatar Snazzah 10-122/+269 2022-07-09feat: update default favicon to new logoGravatar Snazzah 2-1/+1 2022-07-08remove commentsGravatar Hyro 1-97/+0 2022-07-08Fix react example README typo.Gravatar Xing Yahao 1-2/+2