mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
25 lines
457 B
JavaScript
25 lines
457 B
JavaScript
import { noOpForTesting as noop } from "bun:internal-for-testing";
|
|
import { bench, run } from "../runner.mjs";
|
|
|
|
// These are no-op C++ functions that are exported to JS.
|
|
const fn = noop.function;
|
|
const callback = noop.callback;
|
|
|
|
bench("C++ callback into JS", () => {
|
|
callback(() => {});
|
|
});
|
|
|
|
bench("C++ fn", () => {
|
|
fn();
|
|
});
|
|
|
|
bench("C++ getter", () => {
|
|
return noop.getterSetter;
|
|
});
|
|
|
|
bench("C++ setter", () => {
|
|
noop.getterSetter = 1;
|
|
});
|
|
|
|
run();
|