diff options
author | 2022-05-10 20:50:38 -0700 | |
---|---|---|
committer | 2022-05-10 20:50:38 -0700 | |
commit | eb2a6aee4d8450138a5b8acd547616cd651cf0e1 (patch) | |
tree | ee85270733f261053ee09bc13c66cfe3b3301155 | |
parent | 84e8d08ec61facba6089b8190c724b4ca036a687 (diff) | |
download | bun-eb2a6aee4d8450138a5b8acd547616cd651cf0e1.tar.gz bun-eb2a6aee4d8450138a5b8acd547616cd651cf0e1.tar.zst bun-eb2a6aee4d8450138a5b8acd547616cd651cf0e1.zip |
Include napi in plus100
-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 |