Files
bun.sh/bench/ffi/node.mjs
evan a9e4ff2029 cleanup benchmarks folder (#587)
* cleanup benchmarks

* run prettier
2022-07-12 01:40:12 -07:00

17 lines
410 B
JavaScript

import { run, bench, group } from "mitata";
import { createRequire } from "node:module";
const require = createRequire(import.meta.url);
const { napiNoop, napiHash, napiString } = require("./src/ffi_napi_bench.node");
const bytes = new Uint8Array(64);
group("napi", () => {
bench("noop", () => napiNoop());
bench("hash", () => napiHash(bytes));
bench("string", () => napiString());
});
await run();