From f12e72a024a9cfa5c53463e276b2d4281c67d8f9 Mon Sep 17 00:00:00 2001 From: David Herman Date: Mon, 10 Mar 2025 21:37:53 -0700 Subject: [PATCH 1/9] Initial benchmark suite via bench-node --- Cargo.lock | 9 +- Cargo.toml | 1 + bench/.gitignore | 4 + bench/Cargo.toml | 16 ++ bench/README.md | 80 +++++++ bench/index.js | 51 +++++ bench/package-lock.json | 455 ++++++++++++++++++++++++++++++++++++++++ bench/package.json | 27 +++ bench/src/lib.rs | 57 +++++ 9 files changed, 699 insertions(+), 1 deletion(-) create mode 100644 bench/.gitignore create mode 100644 bench/Cargo.toml create mode 100644 bench/README.md create mode 100644 bench/index.js create mode 100644 bench/package-lock.json create mode 100644 bench/package.json create mode 100644 bench/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index 4bfa3fc83..519c09bf0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" @@ -67,6 +67,13 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "bench" +version = "0.1.0" +dependencies = [ + "neon", +] + [[package]] name = "bindgen" version = "0.65.1" diff --git a/Cargo.toml b/Cargo.toml index 48aa747e2..3a34f9852 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,4 +3,5 @@ resolver = "2" members = [ "crates/*", "test/*", + "bench", ] diff --git a/bench/.gitignore b/bench/.gitignore new file mode 100644 index 000000000..c61cbe5d3 --- /dev/null +++ b/bench/.gitignore @@ -0,0 +1,4 @@ +index.node +npm-debug.log* +cargo.log +cross.log diff --git a/bench/Cargo.toml b/bench/Cargo.toml new file mode 100644 index 000000000..5d6c048c9 --- /dev/null +++ b/bench/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "bench" +version = "0.1.0" +description = "Neon benchmark suite" +authors = ["David Herman "] +license = "MIT" +edition = "2021" +exclude = ["index.node"] + +[lib] +crate-type = ["cdylib"] + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +neon = { path = "../crates/neon" } diff --git a/bench/README.md b/bench/README.md new file mode 100644 index 000000000..4cc2c9606 --- /dev/null +++ b/bench/README.md @@ -0,0 +1,80 @@ +# bench + +**bench:** Neon benchmark suite + +This project was bootstrapped by [create-neon](https://www.npmjs.com/package/create-neon). + +## Building bench + +Building bench requires a [supported version of Node and Rust](https://github.com/neon-bindings/neon#platform-support). + +To run the build, run: + +```sh +$ npm run build +``` + +This command uses the [@neon-rs/cli](https://www.npmjs.com/package/@neon-rs/cli) utility to assemble the binary Node addon from the output of `cargo`. + +## Exploring bench + +After building bench, you can explore its exports at the Node console: + +```sh +$ npm i +$ npm run build +$ node +> require('.').hello() +'hello node' +``` + +## Available Scripts + +In the project directory, you can run: + +#### `npm install` + +Installs the project, including running `npm run build`. + +#### `npm run build` + +Builds the Node addon (`index.node`) from source, generating a release build with `cargo --release`. + +Additional [`cargo build`](https://doc.rust-lang.org/cargo/commands/cargo-build.html) arguments may be passed to `npm run build` and similar commands. For example, to enable a [cargo feature](https://doc.rust-lang.org/cargo/reference/features.html): + +``` +npm run build -- --feature=beetle +``` + +## Project Layout + +The directory structure of this project is: + +``` +bench/ +├── Cargo.toml +├── README.md +├── src/ +| └── lib.rs +├── index.node +├── package.json +└── target/ +``` + +| Entry | Purpose | +|----------------|------------------------------------------------------------------------------------------------------------------------------------------| +| `Cargo.toml` | The Cargo [manifest file](https://doc.rust-lang.org/cargo/reference/manifest.html), which informs the `cargo` command. | +| `README.md` | This file. | +| `src/` | The directory tree containing the Rust source code for the project. | +| `lib.rs` | Entry point for the Rust source code. | +| `index.node` | The main module, a [Node addon](https://nodejs.org/api/addons.html) generated by the build and pointed to by `"main"` in `package.json`. | +| `package.json` | The npm [manifest file](https://docs.npmjs.com/cli/v7/configuring-npm/package-json), which informs the `npm` command. | +| `target/` | Binary artifacts generated by the Rust build. | + +## Learn More + +Learn more about: + +- [Neon](https://neon-bindings.com). +- [Rust](https://www.rust-lang.org). +- [Node](https://nodejs.org). diff --git a/bench/index.js b/bench/index.js new file mode 100644 index 000000000..6cfc68dd7 --- /dev/null +++ b/bench/index.js @@ -0,0 +1,51 @@ +const { Suite, jsonReport } = require('bench-node'); +const addon = require('./index.node'); + +// A custom reporter for the bencher.dev benchmarking platform. +// Format: https://bencher.dev/docs/reference/bencher-metric-format/ +function reportBencherDev(results) { + const bmf = Object.create(null); + for (const result of results) { + // If https://github.com/RafaelGSS/bench-node/issues/66 is fixed, then we can use + // result.histogram to report a "latency" measure with the median as the "value", + // min as "lower_value", and max as "upper_value". + bmf[result.name] = { + "throughput": { + "value": result.opsSec, + }, + }; + } + console.log(JSON.stringify(bmf, null, 2)); +} + +const suite = new Suite({ reporter: reportBencherDev }); + +suite.add('hello-world', () => { + addon.hello(); +}); + +suite.add('manually-exported-noop', () => { + addon.manualNoop(); +}); + +suite.add('auto-exported-noop', () => { + addon.exportNoop(); +}); + +function triple(s, n, b) { + return [s, n, b]; +} + +suite.add('JsFunction::call', () => { + addon.callCallbackWithCall(triple); +}); + +suite.add('JsFunction::call_with', () => { + addon.callCallbackWithCallWith(triple); +}); + +suite.add('JsFunction::bind', () => { + addon.callCallbackWithBind(triple); +}); + +suite.run(); diff --git a/bench/package-lock.json b/bench/package-lock.json new file mode 100644 index 000000000..f2d49ade8 --- /dev/null +++ b/bench/package-lock.json @@ -0,0 +1,455 @@ +{ + "name": "bench", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "bench", + "dependencies": { + "bench-node": "^0.5.3" + }, + "devDependencies": { + "@neon-rs/cli": "0.1.82" + } + }, + "node_modules/@cargo-messages/android-arm-eabi": { + "version": "0.1.81", + "resolved": "https://registry.npmjs.org/@cargo-messages/android-arm-eabi/-/android-arm-eabi-0.1.81.tgz", + "integrity": "sha512-cpRbgb56e9LmAj96Tixtz9/bTlaJAeplWNNv4obu+eqQyZd3ZjX04TJd9fM1bjHDGVyR9GTVlgBsbQEntIGkwg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@cargo-messages/darwin-arm64": { + "version": "0.1.81", + "resolved": "https://registry.npmjs.org/@cargo-messages/darwin-arm64/-/darwin-arm64-0.1.81.tgz", + "integrity": "sha512-OwGqsw+tbJx37a/vH4T8R9qkrrFYoTIOnckbA9+MhQodE2FSWyk3HvLh+z8jjl+QZa1RSOU9Ax6gt/46h0BiTg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@cargo-messages/darwin-x64": { + "version": "0.1.81", + "resolved": "https://registry.npmjs.org/@cargo-messages/darwin-x64/-/darwin-x64-0.1.81.tgz", + "integrity": "sha512-Iu761bPk25Ce6yUdDCjjeVuT8/xbBmczyaNB7oYBmAZEE5rshvCJ42TqSShYYP+S7pKkN42nBhkFooaZrqaz9g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@cargo-messages/linux-arm-gnueabihf": { + "version": "0.1.81", + "resolved": "https://registry.npmjs.org/@cargo-messages/linux-arm-gnueabihf/-/linux-arm-gnueabihf-0.1.81.tgz", + "integrity": "sha512-iIuy7KTJAEhbiqlIlcxQOdW6opI6M9LXlgd/jdsHbP2FjmTyhTLnd3JCJ6JeAeidwknCDs+CFlaVmPxTKSytsg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@cargo-messages/linux-arm64-gnu": { + "version": "0.1.81", + "resolved": "https://registry.npmjs.org/@cargo-messages/linux-arm64-gnu/-/linux-arm64-gnu-0.1.81.tgz", + "integrity": "sha512-QPQRsHj9m/9ga8wRBlLh8t2AXyr40+/H55FIKVj7zIjV++waY/TbSTPofDZQhMycd5VSGLKztfhahiCO7c/RAQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@cargo-messages/linux-arm64-musl": { + "version": "0.1.81", + "resolved": "https://registry.npmjs.org/@cargo-messages/linux-arm64-musl/-/linux-arm64-musl-0.1.81.tgz", + "integrity": "sha512-9O0ATesIOjDTz2L01OtlGHYwP86I31/mzXMC+ryQkzbbIKj7KUiSqmEc29I14I517UYO8/sMeow6q6MVBpehlA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@cargo-messages/linux-x64-gnu": { + "version": "0.1.81", + "resolved": "https://registry.npmjs.org/@cargo-messages/linux-x64-gnu/-/linux-x64-gnu-0.1.81.tgz", + "integrity": "sha512-wEFYxCdtHNiEvp5KEg17CfRCUdfRTtkL+1GASROyvYEUV6DQf6TXxfHuuWg2xlVxh5fqiTGFSRfiqFrCDL/xrw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@cargo-messages/linux-x64-musl": { + "version": "0.1.81", + "resolved": "https://registry.npmjs.org/@cargo-messages/linux-x64-musl/-/linux-x64-musl-0.1.81.tgz", + "integrity": "sha512-zi5pKIh60oPwOCDQapAZ3Mya4y56MI2BoGvY8JtztYaXTorGmAoyf6jjb50Wt+HfoYYjM3OlPt03XMlCFZJnIQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@cargo-messages/win32-arm64-msvc": { + "version": "0.1.81", + "resolved": "https://registry.npmjs.org/@cargo-messages/win32-arm64-msvc/-/win32-arm64-msvc-0.1.81.tgz", + "integrity": "sha512-oyiT8AYLoguF7cFOMYDsPv3eirzBcFafOOfRsFyd3+wmaPTl/DdbCq446oThRmSAsEGJpzhzj7TafcnXMBkHbg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@cargo-messages/win32-x64-msvc": { + "version": "0.1.81", + "resolved": "https://registry.npmjs.org/@cargo-messages/win32-x64-msvc/-/win32-x64-msvc-0.1.81.tgz", + "integrity": "sha512-B5Ukf4AohtIv27uCP/AgM+7vYwQ4RacI6m8ZBr2XKeSrjZXcXguzlZd+wD7bD5+wa0capvXKUskZDnpG/DcYiA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@napi-rs/nice": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice/-/nice-1.0.1.tgz", + "integrity": "sha512-zM0mVWSXE0a0h9aKACLwKmD6nHcRiKrPpCfvaKqG1CqDEyjEawId0ocXxVzPMCAm6kkWr2P025msfxXEnt8UGQ==", + "optional": true, + "engines": { + "node": ">= 10" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + }, + "optionalDependencies": { + "@napi-rs/nice-android-arm-eabi": "1.0.1", + "@napi-rs/nice-android-arm64": "1.0.1", + "@napi-rs/nice-darwin-arm64": "1.0.1", + "@napi-rs/nice-darwin-x64": "1.0.1", + "@napi-rs/nice-freebsd-x64": "1.0.1", + "@napi-rs/nice-linux-arm-gnueabihf": "1.0.1", + "@napi-rs/nice-linux-arm64-gnu": "1.0.1", + "@napi-rs/nice-linux-arm64-musl": "1.0.1", + "@napi-rs/nice-linux-ppc64-gnu": "1.0.1", + "@napi-rs/nice-linux-riscv64-gnu": "1.0.1", + "@napi-rs/nice-linux-s390x-gnu": "1.0.1", + "@napi-rs/nice-linux-x64-gnu": "1.0.1", + "@napi-rs/nice-linux-x64-musl": "1.0.1", + "@napi-rs/nice-win32-arm64-msvc": "1.0.1", + "@napi-rs/nice-win32-ia32-msvc": "1.0.1", + "@napi-rs/nice-win32-x64-msvc": "1.0.1" + } + }, + "node_modules/@napi-rs/nice-android-arm-eabi": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-android-arm-eabi/-/nice-android-arm-eabi-1.0.1.tgz", + "integrity": "sha512-5qpvOu5IGwDo7MEKVqqyAxF90I6aLj4n07OzpARdgDRfz8UbBztTByBp0RC59r3J1Ij8uzYi6jI7r5Lws7nn6w==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-android-arm64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-android-arm64/-/nice-android-arm64-1.0.1.tgz", + "integrity": "sha512-GqvXL0P8fZ+mQqG1g0o4AO9hJjQaeYG84FRfZaYjyJtZZZcMjXW5TwkL8Y8UApheJgyE13TQ4YNUssQaTgTyvA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-darwin-arm64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-darwin-arm64/-/nice-darwin-arm64-1.0.1.tgz", + "integrity": "sha512-91k3HEqUl2fsrz/sKkuEkscj6EAj3/eZNCLqzD2AA0TtVbkQi8nqxZCZDMkfklULmxLkMxuUdKe7RvG/T6s2AA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-darwin-x64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-darwin-x64/-/nice-darwin-x64-1.0.1.tgz", + "integrity": "sha512-jXnMleYSIR/+TAN/p5u+NkCA7yidgswx5ftqzXdD5wgy/hNR92oerTXHc0jrlBisbd7DpzoaGY4cFD7Sm5GlgQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-freebsd-x64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-freebsd-x64/-/nice-freebsd-x64-1.0.1.tgz", + "integrity": "sha512-j+iJ/ezONXRQsVIB/FJfwjeQXX7A2tf3gEXs4WUGFrJjpe/z2KB7sOv6zpkm08PofF36C9S7wTNuzHZ/Iiccfw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-linux-arm-gnueabihf": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-linux-arm-gnueabihf/-/nice-linux-arm-gnueabihf-1.0.1.tgz", + "integrity": "sha512-G8RgJ8FYXYkkSGQwywAUh84m946UTn6l03/vmEXBYNJxQJcD+I3B3k5jmjFG/OPiU8DfvxutOP8bi+F89MCV7Q==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-linux-arm64-gnu": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-linux-arm64-gnu/-/nice-linux-arm64-gnu-1.0.1.tgz", + "integrity": "sha512-IMDak59/W5JSab1oZvmNbrms3mHqcreaCeClUjwlwDr0m3BoR09ZiN8cKFBzuSlXgRdZ4PNqCYNeGQv7YMTjuA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-linux-arm64-musl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-linux-arm64-musl/-/nice-linux-arm64-musl-1.0.1.tgz", + "integrity": "sha512-wG8fa2VKuWM4CfjOjjRX9YLIbysSVV1S3Kgm2Fnc67ap/soHBeYZa6AGMeR5BJAylYRjnoVOzV19Cmkco3QEPw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-linux-ppc64-gnu": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-linux-ppc64-gnu/-/nice-linux-ppc64-gnu-1.0.1.tgz", + "integrity": "sha512-lxQ9WrBf0IlNTCA9oS2jg/iAjQyTI6JHzABV664LLrLA/SIdD+I1i3Mjf7TsnoUbgopBcCuDztVLfJ0q9ubf6Q==", + "cpu": [ + "ppc64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-linux-riscv64-gnu": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-linux-riscv64-gnu/-/nice-linux-riscv64-gnu-1.0.1.tgz", + "integrity": "sha512-3xs69dO8WSWBb13KBVex+yvxmUeEsdWexxibqskzoKaWx9AIqkMbWmE2npkazJoopPKX2ULKd8Fm9veEn0g4Ig==", + "cpu": [ + "riscv64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-linux-s390x-gnu": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-linux-s390x-gnu/-/nice-linux-s390x-gnu-1.0.1.tgz", + "integrity": "sha512-lMFI3i9rlW7hgToyAzTaEybQYGbQHDrpRkg+1gJWEpH0PLAQoZ8jiY0IzakLfNWnVda1eTYYlxxFYzW8Rqczkg==", + "cpu": [ + "s390x" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-linux-x64-gnu": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-linux-x64-gnu/-/nice-linux-x64-gnu-1.0.1.tgz", + "integrity": "sha512-XQAJs7DRN2GpLN6Fb+ZdGFeYZDdGl2Fn3TmFlqEL5JorgWKrQGRUrpGKbgZ25UeZPILuTKJ+OowG2avN8mThBA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-linux-x64-musl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-linux-x64-musl/-/nice-linux-x64-musl-1.0.1.tgz", + "integrity": "sha512-/rodHpRSgiI9o1faq9SZOp/o2QkKQg7T+DK0R5AkbnI/YxvAIEHf2cngjYzLMQSQgUhxym+LFr+UGZx4vK4QdQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-win32-arm64-msvc": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-win32-arm64-msvc/-/nice-win32-arm64-msvc-1.0.1.tgz", + "integrity": "sha512-rEcz9vZymaCB3OqEXoHnp9YViLct8ugF+6uO5McifTedjq4QMQs3DHz35xBEGhH3gJWEsXMUbzazkz5KNM5YUg==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-win32-ia32-msvc": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-win32-ia32-msvc/-/nice-win32-ia32-msvc-1.0.1.tgz", + "integrity": "sha512-t7eBAyPUrWL8su3gDxw9xxxqNwZzAqKo0Szv3IjVQd1GpXXVkb6vBBQUuxfIYaXMzZLwlxRQ7uzM2vdUE9ULGw==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-win32-x64-msvc": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-win32-x64-msvc/-/nice-win32-x64-msvc-1.0.1.tgz", + "integrity": "sha512-JlF+uDcatt3St2ntBG8H02F1mM45i5SF9W+bIKiReVE6wiy3o16oBP/yxt+RZ+N6LbCImJXJ6bXNO2kn9AXicg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@neon-rs/cli": { + "version": "0.1.82", + "resolved": "https://registry.npmjs.org/@neon-rs/cli/-/cli-0.1.82.tgz", + "integrity": "sha512-QrlGPQp9KOGuMvjjua79lEV2QTcE16m8JatG5ITdQpBAwRQpDw5xab57W9130y2iUEfMzYtp7v6pcN1fUB0Exg==", + "dev": true, + "bin": { + "neon": "index.js" + }, + "optionalDependencies": { + "@cargo-messages/android-arm-eabi": "0.1.81", + "@cargo-messages/darwin-arm64": "0.1.81", + "@cargo-messages/darwin-x64": "0.1.81", + "@cargo-messages/linux-arm-gnueabihf": "0.1.81", + "@cargo-messages/linux-arm64-gnu": "0.1.81", + "@cargo-messages/linux-arm64-musl": "0.1.81", + "@cargo-messages/linux-x64-gnu": "0.1.81", + "@cargo-messages/linux-x64-musl": "0.1.81", + "@cargo-messages/win32-arm64-msvc": "0.1.81", + "@cargo-messages/win32-x64-msvc": "0.1.81" + } + }, + "node_modules/bench-node": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/bench-node/-/bench-node-0.5.3.tgz", + "integrity": "sha512-1Ai1Sp1O5LIubD6RAPkN93cT67kaSQhGO1VpGRLLNgbmXNIO9covRDpEKnOZ5OJmSAEyFGxKKuaovqV6bvY7tw==", + "dependencies": { + "piscina": "^4.8.0" + } + }, + "node_modules/piscina": { + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/piscina/-/piscina-4.8.0.tgz", + "integrity": "sha512-EZJb+ZxDrQf3dihsUL7p42pjNyrNIFJCrRHPMgxu/svsj+P3xS3fuEWp7k2+rfsavfl1N0G29b1HGs7J0m8rZA==", + "optionalDependencies": { + "@napi-rs/nice": "^1.0.1" + } + } + } +} diff --git a/bench/package.json b/bench/package.json new file mode 100644 index 000000000..eee8e86cf --- /dev/null +++ b/bench/package.json @@ -0,0 +1,27 @@ +{ + "name": "bench", + "private": true, + "description": "Neon benchmark suite", + "main": "index.js", + "scripts": { + "benchmark": "node --allow-natives-syntax index.js", + "cargo-build": "cargo build --message-format=json-render-diagnostics > cargo.log", + "postcargo-build": "neon dist < cargo.log", + "build": "npm run cargo-build -- --release" + }, + "author": "David Herman ", + "devDependencies": { + "@neon-rs/cli": "0.1.82" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/neon-bindings/neon.git" + }, + "bugs": { + "url": "https://github.com/neon-bindings/neon/issues" + }, + "homepage": "https://github.com/neon-bindings/neon#readme", + "dependencies": { + "bench-node": "^0.5.3" + } +} diff --git a/bench/src/lib.rs b/bench/src/lib.rs new file mode 100644 index 000000000..c0059c628 --- /dev/null +++ b/bench/src/lib.rs @@ -0,0 +1,57 @@ +use neon::prelude::*; + +#[neon::export] +fn export_noop() {} + +fn manual_noop(mut cx: FunctionContext) -> JsResult { + Ok(cx.undefined()) +} + +fn hello(mut cx: FunctionContext) -> JsResult { + Ok(cx.string("hello node")) +} + +fn call_callback_with_call(mut cx: FunctionContext) -> JsResult { + let f = cx.argument::(0)?; + let s = cx.string("hello node"); + let n = cx.number(17.0); + let b = cx.boolean(true); + let this = cx.null(); + let args = vec![s.upcast(), n.upcast(), b.upcast()]; + f.call(&mut cx, this, args) +} + +fn call_callback_with_call_with(mut cx: FunctionContext) -> JsResult { + let f = cx.argument::(0)?; + f.call_with(&cx) + .this(cx.null()) + .arg(cx.string("hello node")) + .arg(cx.number(17.0)) + .arg(cx.boolean(true)) + .apply(&mut cx) +} + +fn call_callback_with_bind(mut cx: FunctionContext) -> JsResult { + let f = cx.argument::(0)?; + let this = cx.null(); + f.bind(&mut cx) + .this(this)? + .arg("hello node")? + .arg(17.0)? + .arg(true)? + .call() +} + +#[neon::main] +fn main(mut cx: ModuleContext) -> NeonResult<()> { + // Export all macro-registered exports + neon::registered().export(&mut cx)?; + + cx.export_function("hello", hello)?; + cx.export_function("manualNoop", manual_noop)?; + cx.export_function("callCallbackWithCall", call_callback_with_call)?; + cx.export_function("callCallbackWithCallWith", call_callback_with_call_with)?; + cx.export_function("callCallbackWithBind", call_callback_with_bind)?; + + Ok(()) +} From 1b40d20f1bb66218f3ce18f9395d49ed77401736 Mon Sep 17 00:00:00 2001 From: David Herman Date: Mon, 10 Mar 2025 22:07:20 -0700 Subject: [PATCH 2/9] Ignore bench directory for code coverage reports --- codecov.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 codecov.yml diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 000000000..bc9bf274e --- /dev/null +++ b/codecov.yml @@ -0,0 +1,2 @@ +ignore: + - "bench" From 551647100b42ef063a54517584410c8c31e490e9 Mon Sep 17 00:00:00 2001 From: David Herman Date: Mon, 10 Mar 2025 22:11:35 -0700 Subject: [PATCH 3/9] prettier --- bench/index.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/bench/index.js b/bench/index.js index 6cfc68dd7..d7b3ae95e 100644 --- a/bench/index.js +++ b/bench/index.js @@ -1,5 +1,5 @@ -const { Suite, jsonReport } = require('bench-node'); -const addon = require('./index.node'); +const { Suite, jsonReport } = require("bench-node"); +const addon = require("./index.node"); // A custom reporter for the bencher.dev benchmarking platform. // Format: https://bencher.dev/docs/reference/bencher-metric-format/ @@ -10,8 +10,8 @@ function reportBencherDev(results) { // result.histogram to report a "latency" measure with the median as the "value", // min as "lower_value", and max as "upper_value". bmf[result.name] = { - "throughput": { - "value": result.opsSec, + throughput: { + value: result.opsSec, }, }; } @@ -20,15 +20,15 @@ function reportBencherDev(results) { const suite = new Suite({ reporter: reportBencherDev }); -suite.add('hello-world', () => { +suite.add("hello-world", () => { addon.hello(); }); -suite.add('manually-exported-noop', () => { +suite.add("manually-exported-noop", () => { addon.manualNoop(); }); -suite.add('auto-exported-noop', () => { +suite.add("auto-exported-noop", () => { addon.exportNoop(); }); @@ -36,15 +36,15 @@ function triple(s, n, b) { return [s, n, b]; } -suite.add('JsFunction::call', () => { +suite.add("JsFunction::call", () => { addon.callCallbackWithCall(triple); }); -suite.add('JsFunction::call_with', () => { +suite.add("JsFunction::call_with", () => { addon.callCallbackWithCallWith(triple); }); -suite.add('JsFunction::bind', () => { +suite.add("JsFunction::bind", () => { addon.callCallbackWithBind(triple); }); From 77f7a7b2f39237fa9d8b32249fc8e3ca9d22b03f Mon Sep 17 00:00:00 2001 From: David Herman Date: Thu, 13 Mar 2025 11:22:33 -0700 Subject: [PATCH 4/9] Add latency value to benchmark reporting --- bench/index.js | 23 ++++++++++++++++++++--- bench/package-lock.json | 8 ++++---- bench/package.json | 2 +- 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/bench/index.js b/bench/index.js index d7b3ae95e..7a46a715a 100644 --- a/bench/index.js +++ b/bench/index.js @@ -1,18 +1,35 @@ const { Suite, jsonReport } = require("bench-node"); const addon = require("./index.node"); +function median(values) { + const sorted = [...values].sort((a, b) => a - b); + const n = sorted.length; + return n % 2 === 0 + ? (sorted[n / 2 - 1] + sorted[n / 2]) / 2 + : sorted[Math.floor(n / 2)]; +} + // A custom reporter for the bencher.dev benchmarking platform. // Format: https://bencher.dev/docs/reference/bencher-metric-format/ +// +// The reporter provides two measures for each benchmark: +// - "throughput": The number of operations per second. +// - "latency": The time taken to perform an operation, in ns. +// * "value": The median value of all samples. +// * "lower_value": The minimum value of all samples. +// * "upper_value": The maximum value of all samples. function reportBencherDev(results) { const bmf = Object.create(null); for (const result of results) { - // If https://github.com/RafaelGSS/bench-node/issues/66 is fixed, then we can use - // result.histogram to report a "latency" measure with the median as the "value", - // min as "lower_value", and max as "upper_value". bmf[result.name] = { throughput: { value: result.opsSec, }, + latency: { + value: median(result.histogram.sampleData), + lower_value: result.histogram.min, + upper_value: result.histogram.max, + }, }; } console.log(JSON.stringify(bmf, null, 2)); diff --git a/bench/package-lock.json b/bench/package-lock.json index f2d49ade8..e4b8d010a 100644 --- a/bench/package-lock.json +++ b/bench/package-lock.json @@ -7,7 +7,7 @@ "": { "name": "bench", "dependencies": { - "bench-node": "^0.5.3" + "bench-node": "^0.5.4" }, "devDependencies": { "@neon-rs/cli": "0.1.82" @@ -436,9 +436,9 @@ } }, "node_modules/bench-node": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/bench-node/-/bench-node-0.5.3.tgz", - "integrity": "sha512-1Ai1Sp1O5LIubD6RAPkN93cT67kaSQhGO1VpGRLLNgbmXNIO9covRDpEKnOZ5OJmSAEyFGxKKuaovqV6bvY7tw==", + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/bench-node/-/bench-node-0.5.4.tgz", + "integrity": "sha512-Y2JxV+7CBidBvnKwyWwfRnT0xcX/9ASkirFR5A6FZqdYvX6J2NcGqYjftdvrZZscRsmYKyyegFydJC1bxMuPKA==", "dependencies": { "piscina": "^4.8.0" } diff --git a/bench/package.json b/bench/package.json index eee8e86cf..3ee488ba0 100644 --- a/bench/package.json +++ b/bench/package.json @@ -22,6 +22,6 @@ }, "homepage": "https://github.com/neon-bindings/neon#readme", "dependencies": { - "bench-node": "^0.5.3" + "bench-node": "^0.5.4" } } From b61659417ad3ec873fc81f3a6a40def0362182a6 Mon Sep 17 00:00:00 2001 From: David Herman Date: Thu, 13 Mar 2025 11:27:27 -0700 Subject: [PATCH 5/9] Simplify the readme. --- bench/README.md | 71 +++---------------------------------------------- 1 file changed, 4 insertions(+), 67 deletions(-) diff --git a/bench/README.md b/bench/README.md index 4cc2c9606..34c1b51da 100644 --- a/bench/README.md +++ b/bench/README.md @@ -1,80 +1,17 @@ -# bench - -**bench:** Neon benchmark suite - -This project was bootstrapped by [create-neon](https://www.npmjs.com/package/create-neon). +# bench: Neon benchmark suite ## Building bench -Building bench requires a [supported version of Node and Rust](https://github.com/neon-bindings/neon#platform-support). - To run the build, run: ```sh $ npm run build ``` -This command uses the [@neon-rs/cli](https://www.npmjs.com/package/@neon-rs/cli) utility to assemble the binary Node addon from the output of `cargo`. +## Running the benchmarks -## Exploring bench - -After building bench, you can explore its exports at the Node console: +To run the benchmarks, run: ```sh -$ npm i -$ npm run build -$ node -> require('.').hello() -'hello node' -``` - -## Available Scripts - -In the project directory, you can run: - -#### `npm install` - -Installs the project, including running `npm run build`. - -#### `npm run build` - -Builds the Node addon (`index.node`) from source, generating a release build with `cargo --release`. - -Additional [`cargo build`](https://doc.rust-lang.org/cargo/commands/cargo-build.html) arguments may be passed to `npm run build` and similar commands. For example, to enable a [cargo feature](https://doc.rust-lang.org/cargo/reference/features.html): - -``` -npm run build -- --feature=beetle -``` - -## Project Layout - -The directory structure of this project is: - -``` -bench/ -├── Cargo.toml -├── README.md -├── src/ -| └── lib.rs -├── index.node -├── package.json -└── target/ +$ npm run benchmark ``` - -| Entry | Purpose | -|----------------|------------------------------------------------------------------------------------------------------------------------------------------| -| `Cargo.toml` | The Cargo [manifest file](https://doc.rust-lang.org/cargo/reference/manifest.html), which informs the `cargo` command. | -| `README.md` | This file. | -| `src/` | The directory tree containing the Rust source code for the project. | -| `lib.rs` | Entry point for the Rust source code. | -| `index.node` | The main module, a [Node addon](https://nodejs.org/api/addons.html) generated by the build and pointed to by `"main"` in `package.json`. | -| `package.json` | The npm [manifest file](https://docs.npmjs.com/cli/v7/configuring-npm/package-json), which informs the `npm` command. | -| `target/` | Binary artifacts generated by the Rust build. | - -## Learn More - -Learn more about: - -- [Neon](https://neon-bindings.com). -- [Rust](https://www.rust-lang.org). -- [Node](https://nodejs.org). From 27964fabca7a5ab111683435a2e4ee041c58788d Mon Sep 17 00:00:00 2001 From: David Herman Date: Thu, 13 Mar 2025 11:36:25 -0700 Subject: [PATCH 6/9] More precise description: performance regression suite --- bench/README.md | 2 +- bench/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bench/README.md b/bench/README.md index 34c1b51da..c19fe90d4 100644 --- a/bench/README.md +++ b/bench/README.md @@ -1,4 +1,4 @@ -# bench: Neon benchmark suite +# bench: Neon performance regression suite ## Building bench diff --git a/bench/package.json b/bench/package.json index 3ee488ba0..9c5cd4886 100644 --- a/bench/package.json +++ b/bench/package.json @@ -1,7 +1,7 @@ { "name": "bench", "private": true, - "description": "Neon benchmark suite", + "description": "Neon performance regression suite", "main": "index.js", "scripts": { "benchmark": "node --allow-natives-syntax index.js", From 00459b295f315cad2835d39d74879f18bbd0b0af Mon Sep 17 00:00:00 2001 From: David Herman Date: Thu, 13 Mar 2025 11:38:30 -0700 Subject: [PATCH 7/9] One more description updated --- bench/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bench/Cargo.toml b/bench/Cargo.toml index 5d6c048c9..4b9c03585 100644 --- a/bench/Cargo.toml +++ b/bench/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bench" version = "0.1.0" -description = "Neon benchmark suite" +description = "Neon performance regression suite" authors = ["David Herman "] license = "MIT" edition = "2021" From 4f57b12657d2f909503486ab2b08ce14dd87962f Mon Sep 17 00:00:00 2001 From: David Herman Date: Fri, 14 Mar 2025 09:41:53 -0700 Subject: [PATCH 8/9] Add bench to root workspaces list --- bench/package-lock.json | 455 ---------------------------------------- package-lock.json | 453 ++++++++++++++++++++++++++++++++++++++- package.json | 3 +- 3 files changed, 454 insertions(+), 457 deletions(-) delete mode 100644 bench/package-lock.json diff --git a/bench/package-lock.json b/bench/package-lock.json deleted file mode 100644 index e4b8d010a..000000000 --- a/bench/package-lock.json +++ /dev/null @@ -1,455 +0,0 @@ -{ - "name": "bench", - "version": "0.1.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "bench", - "dependencies": { - "bench-node": "^0.5.4" - }, - "devDependencies": { - "@neon-rs/cli": "0.1.82" - } - }, - "node_modules/@cargo-messages/android-arm-eabi": { - "version": "0.1.81", - "resolved": "https://registry.npmjs.org/@cargo-messages/android-arm-eabi/-/android-arm-eabi-0.1.81.tgz", - "integrity": "sha512-cpRbgb56e9LmAj96Tixtz9/bTlaJAeplWNNv4obu+eqQyZd3ZjX04TJd9fM1bjHDGVyR9GTVlgBsbQEntIGkwg==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@cargo-messages/darwin-arm64": { - "version": "0.1.81", - "resolved": "https://registry.npmjs.org/@cargo-messages/darwin-arm64/-/darwin-arm64-0.1.81.tgz", - "integrity": "sha512-OwGqsw+tbJx37a/vH4T8R9qkrrFYoTIOnckbA9+MhQodE2FSWyk3HvLh+z8jjl+QZa1RSOU9Ax6gt/46h0BiTg==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@cargo-messages/darwin-x64": { - "version": "0.1.81", - "resolved": "https://registry.npmjs.org/@cargo-messages/darwin-x64/-/darwin-x64-0.1.81.tgz", - "integrity": "sha512-Iu761bPk25Ce6yUdDCjjeVuT8/xbBmczyaNB7oYBmAZEE5rshvCJ42TqSShYYP+S7pKkN42nBhkFooaZrqaz9g==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@cargo-messages/linux-arm-gnueabihf": { - "version": "0.1.81", - "resolved": "https://registry.npmjs.org/@cargo-messages/linux-arm-gnueabihf/-/linux-arm-gnueabihf-0.1.81.tgz", - "integrity": "sha512-iIuy7KTJAEhbiqlIlcxQOdW6opI6M9LXlgd/jdsHbP2FjmTyhTLnd3JCJ6JeAeidwknCDs+CFlaVmPxTKSytsg==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@cargo-messages/linux-arm64-gnu": { - "version": "0.1.81", - "resolved": "https://registry.npmjs.org/@cargo-messages/linux-arm64-gnu/-/linux-arm64-gnu-0.1.81.tgz", - "integrity": "sha512-QPQRsHj9m/9ga8wRBlLh8t2AXyr40+/H55FIKVj7zIjV++waY/TbSTPofDZQhMycd5VSGLKztfhahiCO7c/RAQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@cargo-messages/linux-arm64-musl": { - "version": "0.1.81", - "resolved": "https://registry.npmjs.org/@cargo-messages/linux-arm64-musl/-/linux-arm64-musl-0.1.81.tgz", - "integrity": "sha512-9O0ATesIOjDTz2L01OtlGHYwP86I31/mzXMC+ryQkzbbIKj7KUiSqmEc29I14I517UYO8/sMeow6q6MVBpehlA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@cargo-messages/linux-x64-gnu": { - "version": "0.1.81", - "resolved": "https://registry.npmjs.org/@cargo-messages/linux-x64-gnu/-/linux-x64-gnu-0.1.81.tgz", - "integrity": "sha512-wEFYxCdtHNiEvp5KEg17CfRCUdfRTtkL+1GASROyvYEUV6DQf6TXxfHuuWg2xlVxh5fqiTGFSRfiqFrCDL/xrw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@cargo-messages/linux-x64-musl": { - "version": "0.1.81", - "resolved": "https://registry.npmjs.org/@cargo-messages/linux-x64-musl/-/linux-x64-musl-0.1.81.tgz", - "integrity": "sha512-zi5pKIh60oPwOCDQapAZ3Mya4y56MI2BoGvY8JtztYaXTorGmAoyf6jjb50Wt+HfoYYjM3OlPt03XMlCFZJnIQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@cargo-messages/win32-arm64-msvc": { - "version": "0.1.81", - "resolved": "https://registry.npmjs.org/@cargo-messages/win32-arm64-msvc/-/win32-arm64-msvc-0.1.81.tgz", - "integrity": "sha512-oyiT8AYLoguF7cFOMYDsPv3eirzBcFafOOfRsFyd3+wmaPTl/DdbCq446oThRmSAsEGJpzhzj7TafcnXMBkHbg==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@cargo-messages/win32-x64-msvc": { - "version": "0.1.81", - "resolved": "https://registry.npmjs.org/@cargo-messages/win32-x64-msvc/-/win32-x64-msvc-0.1.81.tgz", - "integrity": "sha512-B5Ukf4AohtIv27uCP/AgM+7vYwQ4RacI6m8ZBr2XKeSrjZXcXguzlZd+wD7bD5+wa0capvXKUskZDnpG/DcYiA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@napi-rs/nice": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@napi-rs/nice/-/nice-1.0.1.tgz", - "integrity": "sha512-zM0mVWSXE0a0h9aKACLwKmD6nHcRiKrPpCfvaKqG1CqDEyjEawId0ocXxVzPMCAm6kkWr2P025msfxXEnt8UGQ==", - "optional": true, - "engines": { - "node": ">= 10" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Brooooooklyn" - }, - "optionalDependencies": { - "@napi-rs/nice-android-arm-eabi": "1.0.1", - "@napi-rs/nice-android-arm64": "1.0.1", - "@napi-rs/nice-darwin-arm64": "1.0.1", - "@napi-rs/nice-darwin-x64": "1.0.1", - "@napi-rs/nice-freebsd-x64": "1.0.1", - "@napi-rs/nice-linux-arm-gnueabihf": "1.0.1", - "@napi-rs/nice-linux-arm64-gnu": "1.0.1", - "@napi-rs/nice-linux-arm64-musl": "1.0.1", - "@napi-rs/nice-linux-ppc64-gnu": "1.0.1", - "@napi-rs/nice-linux-riscv64-gnu": "1.0.1", - "@napi-rs/nice-linux-s390x-gnu": "1.0.1", - "@napi-rs/nice-linux-x64-gnu": "1.0.1", - "@napi-rs/nice-linux-x64-musl": "1.0.1", - "@napi-rs/nice-win32-arm64-msvc": "1.0.1", - "@napi-rs/nice-win32-ia32-msvc": "1.0.1", - "@napi-rs/nice-win32-x64-msvc": "1.0.1" - } - }, - "node_modules/@napi-rs/nice-android-arm-eabi": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@napi-rs/nice-android-arm-eabi/-/nice-android-arm-eabi-1.0.1.tgz", - "integrity": "sha512-5qpvOu5IGwDo7MEKVqqyAxF90I6aLj4n07OzpARdgDRfz8UbBztTByBp0RC59r3J1Ij8uzYi6jI7r5Lws7nn6w==", - "cpu": [ - "arm" - ], - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@napi-rs/nice-android-arm64": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@napi-rs/nice-android-arm64/-/nice-android-arm64-1.0.1.tgz", - "integrity": "sha512-GqvXL0P8fZ+mQqG1g0o4AO9hJjQaeYG84FRfZaYjyJtZZZcMjXW5TwkL8Y8UApheJgyE13TQ4YNUssQaTgTyvA==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@napi-rs/nice-darwin-arm64": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@napi-rs/nice-darwin-arm64/-/nice-darwin-arm64-1.0.1.tgz", - "integrity": "sha512-91k3HEqUl2fsrz/sKkuEkscj6EAj3/eZNCLqzD2AA0TtVbkQi8nqxZCZDMkfklULmxLkMxuUdKe7RvG/T6s2AA==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@napi-rs/nice-darwin-x64": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@napi-rs/nice-darwin-x64/-/nice-darwin-x64-1.0.1.tgz", - "integrity": "sha512-jXnMleYSIR/+TAN/p5u+NkCA7yidgswx5ftqzXdD5wgy/hNR92oerTXHc0jrlBisbd7DpzoaGY4cFD7Sm5GlgQ==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@napi-rs/nice-freebsd-x64": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@napi-rs/nice-freebsd-x64/-/nice-freebsd-x64-1.0.1.tgz", - "integrity": "sha512-j+iJ/ezONXRQsVIB/FJfwjeQXX7A2tf3gEXs4WUGFrJjpe/z2KB7sOv6zpkm08PofF36C9S7wTNuzHZ/Iiccfw==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@napi-rs/nice-linux-arm-gnueabihf": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@napi-rs/nice-linux-arm-gnueabihf/-/nice-linux-arm-gnueabihf-1.0.1.tgz", - "integrity": "sha512-G8RgJ8FYXYkkSGQwywAUh84m946UTn6l03/vmEXBYNJxQJcD+I3B3k5jmjFG/OPiU8DfvxutOP8bi+F89MCV7Q==", - "cpu": [ - "arm" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@napi-rs/nice-linux-arm64-gnu": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@napi-rs/nice-linux-arm64-gnu/-/nice-linux-arm64-gnu-1.0.1.tgz", - "integrity": "sha512-IMDak59/W5JSab1oZvmNbrms3mHqcreaCeClUjwlwDr0m3BoR09ZiN8cKFBzuSlXgRdZ4PNqCYNeGQv7YMTjuA==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@napi-rs/nice-linux-arm64-musl": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@napi-rs/nice-linux-arm64-musl/-/nice-linux-arm64-musl-1.0.1.tgz", - "integrity": "sha512-wG8fa2VKuWM4CfjOjjRX9YLIbysSVV1S3Kgm2Fnc67ap/soHBeYZa6AGMeR5BJAylYRjnoVOzV19Cmkco3QEPw==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@napi-rs/nice-linux-ppc64-gnu": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@napi-rs/nice-linux-ppc64-gnu/-/nice-linux-ppc64-gnu-1.0.1.tgz", - "integrity": "sha512-lxQ9WrBf0IlNTCA9oS2jg/iAjQyTI6JHzABV664LLrLA/SIdD+I1i3Mjf7TsnoUbgopBcCuDztVLfJ0q9ubf6Q==", - "cpu": [ - "ppc64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@napi-rs/nice-linux-riscv64-gnu": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@napi-rs/nice-linux-riscv64-gnu/-/nice-linux-riscv64-gnu-1.0.1.tgz", - "integrity": "sha512-3xs69dO8WSWBb13KBVex+yvxmUeEsdWexxibqskzoKaWx9AIqkMbWmE2npkazJoopPKX2ULKd8Fm9veEn0g4Ig==", - "cpu": [ - "riscv64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@napi-rs/nice-linux-s390x-gnu": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@napi-rs/nice-linux-s390x-gnu/-/nice-linux-s390x-gnu-1.0.1.tgz", - "integrity": "sha512-lMFI3i9rlW7hgToyAzTaEybQYGbQHDrpRkg+1gJWEpH0PLAQoZ8jiY0IzakLfNWnVda1eTYYlxxFYzW8Rqczkg==", - "cpu": [ - "s390x" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@napi-rs/nice-linux-x64-gnu": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@napi-rs/nice-linux-x64-gnu/-/nice-linux-x64-gnu-1.0.1.tgz", - "integrity": "sha512-XQAJs7DRN2GpLN6Fb+ZdGFeYZDdGl2Fn3TmFlqEL5JorgWKrQGRUrpGKbgZ25UeZPILuTKJ+OowG2avN8mThBA==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@napi-rs/nice-linux-x64-musl": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@napi-rs/nice-linux-x64-musl/-/nice-linux-x64-musl-1.0.1.tgz", - "integrity": "sha512-/rodHpRSgiI9o1faq9SZOp/o2QkKQg7T+DK0R5AkbnI/YxvAIEHf2cngjYzLMQSQgUhxym+LFr+UGZx4vK4QdQ==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@napi-rs/nice-win32-arm64-msvc": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@napi-rs/nice-win32-arm64-msvc/-/nice-win32-arm64-msvc-1.0.1.tgz", - "integrity": "sha512-rEcz9vZymaCB3OqEXoHnp9YViLct8ugF+6uO5McifTedjq4QMQs3DHz35xBEGhH3gJWEsXMUbzazkz5KNM5YUg==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@napi-rs/nice-win32-ia32-msvc": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@napi-rs/nice-win32-ia32-msvc/-/nice-win32-ia32-msvc-1.0.1.tgz", - "integrity": "sha512-t7eBAyPUrWL8su3gDxw9xxxqNwZzAqKo0Szv3IjVQd1GpXXVkb6vBBQUuxfIYaXMzZLwlxRQ7uzM2vdUE9ULGw==", - "cpu": [ - "ia32" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@napi-rs/nice-win32-x64-msvc": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@napi-rs/nice-win32-x64-msvc/-/nice-win32-x64-msvc-1.0.1.tgz", - "integrity": "sha512-JlF+uDcatt3St2ntBG8H02F1mM45i5SF9W+bIKiReVE6wiy3o16oBP/yxt+RZ+N6LbCImJXJ6bXNO2kn9AXicg==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@neon-rs/cli": { - "version": "0.1.82", - "resolved": "https://registry.npmjs.org/@neon-rs/cli/-/cli-0.1.82.tgz", - "integrity": "sha512-QrlGPQp9KOGuMvjjua79lEV2QTcE16m8JatG5ITdQpBAwRQpDw5xab57W9130y2iUEfMzYtp7v6pcN1fUB0Exg==", - "dev": true, - "bin": { - "neon": "index.js" - }, - "optionalDependencies": { - "@cargo-messages/android-arm-eabi": "0.1.81", - "@cargo-messages/darwin-arm64": "0.1.81", - "@cargo-messages/darwin-x64": "0.1.81", - "@cargo-messages/linux-arm-gnueabihf": "0.1.81", - "@cargo-messages/linux-arm64-gnu": "0.1.81", - "@cargo-messages/linux-arm64-musl": "0.1.81", - "@cargo-messages/linux-x64-gnu": "0.1.81", - "@cargo-messages/linux-x64-musl": "0.1.81", - "@cargo-messages/win32-arm64-msvc": "0.1.81", - "@cargo-messages/win32-x64-msvc": "0.1.81" - } - }, - "node_modules/bench-node": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/bench-node/-/bench-node-0.5.4.tgz", - "integrity": "sha512-Y2JxV+7CBidBvnKwyWwfRnT0xcX/9ASkirFR5A6FZqdYvX6J2NcGqYjftdvrZZscRsmYKyyegFydJC1bxMuPKA==", - "dependencies": { - "piscina": "^4.8.0" - } - }, - "node_modules/piscina": { - "version": "4.8.0", - "resolved": "https://registry.npmjs.org/piscina/-/piscina-4.8.0.tgz", - "integrity": "sha512-EZJb+ZxDrQf3dihsUL7p42pjNyrNIFJCrRHPMgxu/svsj+P3xS3fuEWp7k2+rfsavfl1N0G29b1HGs7J0m8rZA==", - "optionalDependencies": { - "@napi-rs/nice": "^1.0.1" - } - } - } -} diff --git a/package-lock.json b/package-lock.json index b6617da57..fbfa6ab52 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,12 +7,21 @@ "name": "neon-workspace", "workspaces": [ "pkgs/*", - "test/*" + "test/*", + "bench" ], "devDependencies": { "prettier": "^2.7.1" } }, + "bench": { + "dependencies": { + "bench-node": "^0.5.4" + }, + "devDependencies": { + "@neon-rs/cli": "0.1.82" + } + }, "node_modules/@75lb/deep-merge": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@75lb/deep-merge/-/deep-merge-1.1.1.tgz", @@ -768,6 +777,136 @@ "node": ">=6.9.0" } }, + "node_modules/@cargo-messages/android-arm-eabi": { + "version": "0.1.81", + "resolved": "https://registry.npmjs.org/@cargo-messages/android-arm-eabi/-/android-arm-eabi-0.1.81.tgz", + "integrity": "sha512-cpRbgb56e9LmAj96Tixtz9/bTlaJAeplWNNv4obu+eqQyZd3ZjX04TJd9fM1bjHDGVyR9GTVlgBsbQEntIGkwg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@cargo-messages/darwin-arm64": { + "version": "0.1.81", + "resolved": "https://registry.npmjs.org/@cargo-messages/darwin-arm64/-/darwin-arm64-0.1.81.tgz", + "integrity": "sha512-OwGqsw+tbJx37a/vH4T8R9qkrrFYoTIOnckbA9+MhQodE2FSWyk3HvLh+z8jjl+QZa1RSOU9Ax6gt/46h0BiTg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@cargo-messages/darwin-x64": { + "version": "0.1.81", + "resolved": "https://registry.npmjs.org/@cargo-messages/darwin-x64/-/darwin-x64-0.1.81.tgz", + "integrity": "sha512-Iu761bPk25Ce6yUdDCjjeVuT8/xbBmczyaNB7oYBmAZEE5rshvCJ42TqSShYYP+S7pKkN42nBhkFooaZrqaz9g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@cargo-messages/linux-arm-gnueabihf": { + "version": "0.1.81", + "resolved": "https://registry.npmjs.org/@cargo-messages/linux-arm-gnueabihf/-/linux-arm-gnueabihf-0.1.81.tgz", + "integrity": "sha512-iIuy7KTJAEhbiqlIlcxQOdW6opI6M9LXlgd/jdsHbP2FjmTyhTLnd3JCJ6JeAeidwknCDs+CFlaVmPxTKSytsg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@cargo-messages/linux-arm64-gnu": { + "version": "0.1.81", + "resolved": "https://registry.npmjs.org/@cargo-messages/linux-arm64-gnu/-/linux-arm64-gnu-0.1.81.tgz", + "integrity": "sha512-QPQRsHj9m/9ga8wRBlLh8t2AXyr40+/H55FIKVj7zIjV++waY/TbSTPofDZQhMycd5VSGLKztfhahiCO7c/RAQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@cargo-messages/linux-arm64-musl": { + "version": "0.1.81", + "resolved": "https://registry.npmjs.org/@cargo-messages/linux-arm64-musl/-/linux-arm64-musl-0.1.81.tgz", + "integrity": "sha512-9O0ATesIOjDTz2L01OtlGHYwP86I31/mzXMC+ryQkzbbIKj7KUiSqmEc29I14I517UYO8/sMeow6q6MVBpehlA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@cargo-messages/linux-x64-gnu": { + "version": "0.1.81", + "resolved": "https://registry.npmjs.org/@cargo-messages/linux-x64-gnu/-/linux-x64-gnu-0.1.81.tgz", + "integrity": "sha512-wEFYxCdtHNiEvp5KEg17CfRCUdfRTtkL+1GASROyvYEUV6DQf6TXxfHuuWg2xlVxh5fqiTGFSRfiqFrCDL/xrw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@cargo-messages/linux-x64-musl": { + "version": "0.1.81", + "resolved": "https://registry.npmjs.org/@cargo-messages/linux-x64-musl/-/linux-x64-musl-0.1.81.tgz", + "integrity": "sha512-zi5pKIh60oPwOCDQapAZ3Mya4y56MI2BoGvY8JtztYaXTorGmAoyf6jjb50Wt+HfoYYjM3OlPt03XMlCFZJnIQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@cargo-messages/win32-arm64-msvc": { + "version": "0.1.81", + "resolved": "https://registry.npmjs.org/@cargo-messages/win32-arm64-msvc/-/win32-arm64-msvc-0.1.81.tgz", + "integrity": "sha512-oyiT8AYLoguF7cFOMYDsPv3eirzBcFafOOfRsFyd3+wmaPTl/DdbCq446oThRmSAsEGJpzhzj7TafcnXMBkHbg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@cargo-messages/win32-x64-msvc": { + "version": "0.1.81", + "resolved": "https://registry.npmjs.org/@cargo-messages/win32-x64-msvc/-/win32-x64-msvc-0.1.81.tgz", + "integrity": "sha512-B5Ukf4AohtIv27uCP/AgM+7vYwQ4RacI6m8ZBr2XKeSrjZXcXguzlZd+wD7bD5+wa0capvXKUskZDnpG/DcYiA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, "node_modules/@electron/get": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@electron/get/-/get-2.0.3.tgz", @@ -832,6 +971,298 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@napi-rs/nice": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice/-/nice-1.0.1.tgz", + "integrity": "sha512-zM0mVWSXE0a0h9aKACLwKmD6nHcRiKrPpCfvaKqG1CqDEyjEawId0ocXxVzPMCAm6kkWr2P025msfxXEnt8UGQ==", + "optional": true, + "engines": { + "node": ">= 10" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + }, + "optionalDependencies": { + "@napi-rs/nice-android-arm-eabi": "1.0.1", + "@napi-rs/nice-android-arm64": "1.0.1", + "@napi-rs/nice-darwin-arm64": "1.0.1", + "@napi-rs/nice-darwin-x64": "1.0.1", + "@napi-rs/nice-freebsd-x64": "1.0.1", + "@napi-rs/nice-linux-arm-gnueabihf": "1.0.1", + "@napi-rs/nice-linux-arm64-gnu": "1.0.1", + "@napi-rs/nice-linux-arm64-musl": "1.0.1", + "@napi-rs/nice-linux-ppc64-gnu": "1.0.1", + "@napi-rs/nice-linux-riscv64-gnu": "1.0.1", + "@napi-rs/nice-linux-s390x-gnu": "1.0.1", + "@napi-rs/nice-linux-x64-gnu": "1.0.1", + "@napi-rs/nice-linux-x64-musl": "1.0.1", + "@napi-rs/nice-win32-arm64-msvc": "1.0.1", + "@napi-rs/nice-win32-ia32-msvc": "1.0.1", + "@napi-rs/nice-win32-x64-msvc": "1.0.1" + } + }, + "node_modules/@napi-rs/nice-android-arm-eabi": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-android-arm-eabi/-/nice-android-arm-eabi-1.0.1.tgz", + "integrity": "sha512-5qpvOu5IGwDo7MEKVqqyAxF90I6aLj4n07OzpARdgDRfz8UbBztTByBp0RC59r3J1Ij8uzYi6jI7r5Lws7nn6w==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-android-arm64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-android-arm64/-/nice-android-arm64-1.0.1.tgz", + "integrity": "sha512-GqvXL0P8fZ+mQqG1g0o4AO9hJjQaeYG84FRfZaYjyJtZZZcMjXW5TwkL8Y8UApheJgyE13TQ4YNUssQaTgTyvA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-darwin-arm64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-darwin-arm64/-/nice-darwin-arm64-1.0.1.tgz", + "integrity": "sha512-91k3HEqUl2fsrz/sKkuEkscj6EAj3/eZNCLqzD2AA0TtVbkQi8nqxZCZDMkfklULmxLkMxuUdKe7RvG/T6s2AA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-darwin-x64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-darwin-x64/-/nice-darwin-x64-1.0.1.tgz", + "integrity": "sha512-jXnMleYSIR/+TAN/p5u+NkCA7yidgswx5ftqzXdD5wgy/hNR92oerTXHc0jrlBisbd7DpzoaGY4cFD7Sm5GlgQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-freebsd-x64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-freebsd-x64/-/nice-freebsd-x64-1.0.1.tgz", + "integrity": "sha512-j+iJ/ezONXRQsVIB/FJfwjeQXX7A2tf3gEXs4WUGFrJjpe/z2KB7sOv6zpkm08PofF36C9S7wTNuzHZ/Iiccfw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-linux-arm-gnueabihf": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-linux-arm-gnueabihf/-/nice-linux-arm-gnueabihf-1.0.1.tgz", + "integrity": "sha512-G8RgJ8FYXYkkSGQwywAUh84m946UTn6l03/vmEXBYNJxQJcD+I3B3k5jmjFG/OPiU8DfvxutOP8bi+F89MCV7Q==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-linux-arm64-gnu": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-linux-arm64-gnu/-/nice-linux-arm64-gnu-1.0.1.tgz", + "integrity": "sha512-IMDak59/W5JSab1oZvmNbrms3mHqcreaCeClUjwlwDr0m3BoR09ZiN8cKFBzuSlXgRdZ4PNqCYNeGQv7YMTjuA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-linux-arm64-musl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-linux-arm64-musl/-/nice-linux-arm64-musl-1.0.1.tgz", + "integrity": "sha512-wG8fa2VKuWM4CfjOjjRX9YLIbysSVV1S3Kgm2Fnc67ap/soHBeYZa6AGMeR5BJAylYRjnoVOzV19Cmkco3QEPw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-linux-ppc64-gnu": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-linux-ppc64-gnu/-/nice-linux-ppc64-gnu-1.0.1.tgz", + "integrity": "sha512-lxQ9WrBf0IlNTCA9oS2jg/iAjQyTI6JHzABV664LLrLA/SIdD+I1i3Mjf7TsnoUbgopBcCuDztVLfJ0q9ubf6Q==", + "cpu": [ + "ppc64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-linux-riscv64-gnu": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-linux-riscv64-gnu/-/nice-linux-riscv64-gnu-1.0.1.tgz", + "integrity": "sha512-3xs69dO8WSWBb13KBVex+yvxmUeEsdWexxibqskzoKaWx9AIqkMbWmE2npkazJoopPKX2ULKd8Fm9veEn0g4Ig==", + "cpu": [ + "riscv64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-linux-s390x-gnu": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-linux-s390x-gnu/-/nice-linux-s390x-gnu-1.0.1.tgz", + "integrity": "sha512-lMFI3i9rlW7hgToyAzTaEybQYGbQHDrpRkg+1gJWEpH0PLAQoZ8jiY0IzakLfNWnVda1eTYYlxxFYzW8Rqczkg==", + "cpu": [ + "s390x" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-linux-x64-gnu": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-linux-x64-gnu/-/nice-linux-x64-gnu-1.0.1.tgz", + "integrity": "sha512-XQAJs7DRN2GpLN6Fb+ZdGFeYZDdGl2Fn3TmFlqEL5JorgWKrQGRUrpGKbgZ25UeZPILuTKJ+OowG2avN8mThBA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-linux-x64-musl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-linux-x64-musl/-/nice-linux-x64-musl-1.0.1.tgz", + "integrity": "sha512-/rodHpRSgiI9o1faq9SZOp/o2QkKQg7T+DK0R5AkbnI/YxvAIEHf2cngjYzLMQSQgUhxym+LFr+UGZx4vK4QdQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-win32-arm64-msvc": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-win32-arm64-msvc/-/nice-win32-arm64-msvc-1.0.1.tgz", + "integrity": "sha512-rEcz9vZymaCB3OqEXoHnp9YViLct8ugF+6uO5McifTedjq4QMQs3DHz35xBEGhH3gJWEsXMUbzazkz5KNM5YUg==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-win32-ia32-msvc": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-win32-ia32-msvc/-/nice-win32-ia32-msvc-1.0.1.tgz", + "integrity": "sha512-t7eBAyPUrWL8su3gDxw9xxxqNwZzAqKo0Szv3IjVQd1GpXXVkb6vBBQUuxfIYaXMzZLwlxRQ7uzM2vdUE9ULGw==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/nice-win32-x64-msvc": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@napi-rs/nice-win32-x64-msvc/-/nice-win32-x64-msvc-1.0.1.tgz", + "integrity": "sha512-JlF+uDcatt3St2ntBG8H02F1mM45i5SF9W+bIKiReVE6wiy3o16oBP/yxt+RZ+N6LbCImJXJ6bXNO2kn9AXicg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@neon-rs/cli": { + "version": "0.1.82", + "resolved": "https://registry.npmjs.org/@neon-rs/cli/-/cli-0.1.82.tgz", + "integrity": "sha512-QrlGPQp9KOGuMvjjua79lEV2QTcE16m8JatG5ITdQpBAwRQpDw5xab57W9130y2iUEfMzYtp7v6pcN1fUB0Exg==", + "dev": true, + "bin": { + "neon": "index.js" + }, + "optionalDependencies": { + "@cargo-messages/android-arm-eabi": "0.1.81", + "@cargo-messages/darwin-arm64": "0.1.81", + "@cargo-messages/darwin-x64": "0.1.81", + "@cargo-messages/linux-arm-gnueabihf": "0.1.81", + "@cargo-messages/linux-arm64-gnu": "0.1.81", + "@cargo-messages/linux-arm64-musl": "0.1.81", + "@cargo-messages/linux-x64-gnu": "0.1.81", + "@cargo-messages/linux-x64-musl": "0.1.81", + "@cargo-messages/win32-arm64-msvc": "0.1.81", + "@cargo-messages/win32-x64-msvc": "0.1.81" + } + }, "node_modules/@neon-rs/manifest": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/@neon-rs/manifest/-/manifest-0.2.1.tgz", @@ -1479,6 +1910,18 @@ "node": ">=0.10.0" } }, + "node_modules/bench": { + "resolved": "bench", + "link": true + }, + "node_modules/bench-node": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/bench-node/-/bench-node-0.5.4.tgz", + "integrity": "sha512-Y2JxV+7CBidBvnKwyWwfRnT0xcX/9ASkirFR5A6FZqdYvX6J2NcGqYjftdvrZZscRsmYKyyegFydJC1bxMuPKA==", + "dependencies": { + "piscina": "^4.8.0" + } + }, "node_modules/binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", @@ -4588,6 +5031,14 @@ "node": ">= 6" } }, + "node_modules/piscina": { + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/piscina/-/piscina-4.8.0.tgz", + "integrity": "sha512-EZJb+ZxDrQf3dihsUL7p42pjNyrNIFJCrRHPMgxu/svsj+P3xS3fuEWp7k2+rfsavfl1N0G29b1HGs7J0m8rZA==", + "optionalDependencies": { + "@napi-rs/nice": "^1.0.1" + } + }, "node_modules/pkg-dir": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", diff --git a/package.json b/package.json index 35885c27b..e879df652 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,8 @@ }, "workspaces": [ "pkgs/*", - "test/*" + "test/*", + "bench" ], "devDependencies": { "prettier": "^2.7.1" From 72ecea3692d88e457d51827545a5a93a1487e33f Mon Sep 17 00:00:00 2001 From: David Herman Date: Fri, 14 Mar 2025 09:46:50 -0700 Subject: [PATCH 9/9] unify codecov configuration in config file --- .github/workflows/ci.yml | 2 +- codecov.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 38e8ac621..7ba098a0e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -117,7 +117,7 @@ jobs: - name: Generate coverage report if: matrix.os == 'ubuntu-latest' && matrix.rust-toolchain == 'stable' - run: cargo llvm-cov report --ignore-filename-regex test --codecov --output-path target/codecov.json + run: cargo llvm-cov report --codecov --output-path target/codecov.json - name: Upload coverage to Codecov if: matrix.os == 'ubuntu-latest' && matrix.rust-toolchain == 'stable' diff --git a/codecov.yml b/codecov.yml index bc9bf274e..d9bc945f5 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,2 +1,3 @@ ignore: - "bench" + - "test"