diff options
-rw-r--r-- | bench/ffi/plus100/plus100.bun.js | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/bench/ffi/plus100/plus100.bun.js b/bench/ffi/plus100/plus100.bun.js index 3eb4de02e..0322b8f01 100644 --- a/bench/ffi/plus100/plus100.bun.js +++ b/bench/ffi/plus100/plus100.bun.js @@ -16,12 +16,28 @@ const { args: [], }, }); -bench("plus100(1) ", () => { - plus100(1); +const napi = { exports: {} }; +process.dlopen(napi, "plus100-napi/package-template.darwin-arm64.node"); +const { plus100: plus100napi, noop: noopNapi } = napi.exports; + +group("plus100", () => { + bench("plus100(1) ffi", () => { + plus100(1); + }); + + bench("plus100(1) napi", () => { + plus100napi(1); + }); }); -bench("noop() ", () => { - noop(); +group("noop", () => { + bench("noop() ffi", () => { + noop(); + }); + + bench("noop() napi", () => { + noopNapi(); + }); }); // collect option collects benchmark returned values into array |