bench: add experimental node:bench module - #65606
Conversation
|
Review requested:
|
This comment was marked as outdated.
This comment was marked as outdated.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #65606 +/- ##
==========================================
+ Coverage 90.06% 90.14% +0.08%
==========================================
Files 754 764 +10
Lines 255747 258220 +2473
Branches 48318 48885 +567
==========================================
+ Hits 230327 232769 +2442
- Misses 16550 16557 +7
- Partials 8870 8894 +24
🚀 New features to boost your workflow:
|
|
@RafaelGSS probably nothing except that hopefully now it can progress. My question would be: why not vendor https://www.npmjs.com/package/bench-node? |
I initially considered vendoring one of the existing packages and opted against it in favor of a light weight, minimal, no-new-dependency approach that a more feature-rich tool like bench-node can build/iterate on. I don't consider these either/or options. Node.js' own benchmarks demonstrate that the full set of features provided by bench-node aren't necessary for a minimal bench suite.
We can provide stable measurement and structured result primitives without needing to ship the larger user-facing feature set and these existing tools can continue serving their current users while optionally adopting the built-in foundation. Just like That said, this is just a starting point. I've never been one to say "It must be done this specific way!" so all options are on the table. What I want is a built-in |
If I can't do it with
I'm with you. I just think it's easier to deliver what folks would actually want out of the module by bringing something like |
9176490 to
f5af443
Compare
different folks "actually want" different things. You prove this point yourself with the "If I can't do it with node:test I just don't worry about it" comment. Node.js' own benchmarks don't require any of the extended features of |
Maybe, but aren't standard library modules meant to provide utility to the community, not just the project itself? |
Why not both? I'm intentionally designing this for both cases. Standalone utility plus primitives that can be used by tools like |
f5af443 to
2c0ddc5
Compare
|
Large PR Review Guide: Given that this is a large PR for a new subsystem... some guidance for review:
|
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
How does this compare to mitata? |
Signed-off-by: James M Snell <jasnell@gmail.com> Assisted-by: Opencode
Refs: #65606 (comment) Refs: #65606 (comment) Refs: #65606 (comment) PR-URL: #65631 Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Signed-off-by: James M Snell <jasnell@gmail.com> Assisted-by: Opencode PR-URL: #65606 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Signed-off-by: James M Snell <jasnell@gmail.com> Assisted-by: Opencode PR-URL: #65606 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Signed-off-by: James M Snell <jasnell@gmail.com> Assisted-by: Opencode PR-URL: #65606 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Signed-off-by: James M Snell <jasnell@gmail.com> Assisted-by: Opencode PR-URL: #65606 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Signed-off-by: James M Snel <jasnell@gmail.com> Assisted-by: Opencode PR-URL: #65606 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: #65606 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Makes it easier for benchmark tools to build on top of the bench runner primitives. Signed-off-by: James M Snell <jasnell@gmail.com> Assisted-by: Opencode PR-URL: #65606 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Signed-off-by: James M Snell <jasnell@gmail.com> Assisted-by: Opencode PR-URL: #65606 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Signed-off-by: James M Snell <jasnell@gmail.com> Assisted-by: Opencode PR-URL: #65606 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: #65606 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Refs: #65606 (comment) Refs: #65606 (comment) Refs: #65606 (comment) PR-URL: #65631 Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Notable changes: benchmark: * (SEMVER-MINOR) implement node:bench version of bench tools (James M Snell) #65606 crypto: * (SEMVER-MINOR) add a generic MAC API (Filip Skokan) #65553 * (SEMVER-MINOR) discover ciphers from OpenSSL providers (Filip Skokan) #65484 * (SEMVER-MINOR) discover hashes from OpenSSL providers (Filip Skokan) #65484 doc: * (SEMVER-MINOR) move histogram.burnRate to correct location in doc (James M Snell) #65434 * deprecate `Server.prototype._listen2` in `node:net` (Antoine du Hamel) #65593 ffi: * (SEMVER-MINOR) enable module by default (Matteo Collina) #65475 lib: * (SEMVER-MINOR) add `node:bench` explicit createRunner (James M Snell) #65606 * (SEMVER-MINOR) complete the implementation of node:bench and cli (James M Snell) #65606 * (SEMVER-MINOR) implement bench/reporters (James M Snell) #65606 * (SEMVER-MINOR) implement node:bench (James M Snell) #65606 meta: * refine the security vuln posture for experimental features (James M Snell) #65438 perf_hooks: * (SEMVER-MINOR) implement Histogram meanCI API (James M Snell) #65606 * (SEMVER-MINOR) add CBOR export/import for histogram exchange (James M Snell) #65434 src: * (SEMVER-MINOR) fixup histogram and options linting issues (James M Snell) #65606 * (SEMVER-MINOR) let embedders supply a builtin code cache without a snapshot (Shelley Vohr) #65352 src, lib: * (SEMVER-MINOR) add stats to dtls (James M Snell) #63182 src,lib: * (SEMVER-MINOR) add dtls interop tests (James M Snell) #63182 * (SEMVER-MINOR) implement experimental DTLS API (James M Snell) #63182 test: * (SEMVER-MINOR) fix node:bench test timing (James M Snell) #65606 * (SEMVER-MINOR) improve node:bench test coverage (James M Snell) #65606 * (SEMVER-MINOR) update bench tests to not fail on no-crypto (James M Snell) #65606 * (SEMVER-MINOR) use native builder for legacy SEA tests (Filip Skokan) #65553 * (SEMVER-MINOR) enable multi-global WPTs (Filip Skokan) #64894 * (SEMVER-MINOR) add opt-in process WPT runner (Filip Skokan) #64894 * (SEMVER-MINOR) accomodate multi-global tests in WPT{Runner,TestSpec,Report} (Filip Skokan) #64894 vfs: * (SEMVER-MINOR) integrate with CJS and ESM module loaders (Matteo Collina) #63653 worker: * (SEMVER-MINOR) add wpt tests for Web Workers (Aviv Keller) #64894 * (SEMVER-MINOR) add support for Web Workers (Aviv Keller) #64894 PR-URL: #65881
Notable changes: crypto: * (SEMVER-MINOR) add a generic MAC API (Filip Skokan) #65553 * (SEMVER-MINOR) discover ciphers from OpenSSL providers (Filip Skokan) #65484 * (SEMVER-MINOR) discover hashes from OpenSSL providers (Filip Skokan) #65484 doc: * deprecate `Server.prototype._listen2` in `node:net` (Antoine du Hamel) #65593 ffi: * (SEMVER-MINOR) enable module by default (Matteo Collina) #65475 lib: * (SEMVER-MINOR) implement node:bench (James M Snell) #65606 meta: * refine the security vuln posture for experimental features (James M Snell) #65438 perf_hooks: * (SEMVER-MINOR) implement Histogram meanCI API (James M Snell) #65606 * (SEMVER-MINOR) add CBOR export/import for histogram exchange (James M Snell) #65434 src: * (SEMVER-MINOR) let embedders supply a builtin code cache without a snapshot (Shelley Vohr) #65352 src,lib: * (SEMVER-MINOR) implement experimental DTLS API (James M Snell) #63182 vfs: * (SEMVER-MINOR) integrate with CJS and ESM module loaders (Matteo Collina) #63653 worker: * (SEMVER-MINOR) add support for Web Workers (Aviv Keller) #64894 PR-URL: #65881
Signed-off-by: James M Snell <jasnell@gmail.com> Assisted-by: Opencode PR-URL: #65606 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Signed-off-by: James M Snell <jasnell@gmail.com> Assisted-by: Opencode PR-URL: #65606 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Signed-off-by: James M Snell <jasnell@gmail.com> Assisted-by: Opencode PR-URL: #65606 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Signed-off-by: James M Snell <jasnell@gmail.com> Assisted-by: Opencode PR-URL: #65606 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Signed-off-by: James M Snel <jasnell@gmail.com> Assisted-by: Opencode PR-URL: #65606 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: #65606 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Makes it easier for benchmark tools to build on top of the bench runner primitives. Signed-off-by: James M Snell <jasnell@gmail.com> Assisted-by: Opencode PR-URL: #65606 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Signed-off-by: James M Snell <jasnell@gmail.com> Assisted-by: Opencode PR-URL: #65606 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Signed-off-by: James M Snell <jasnell@gmail.com> Assisted-by: Opencode PR-URL: #65606 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: #65606 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Refs: #65606 (comment) Refs: #65606 (comment) Refs: #65606 (comment) PR-URL: #65631 Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Notable changes: crypto: * (SEMVER-MINOR) add a generic MAC API (Filip Skokan) #65553 * (SEMVER-MINOR) discover ciphers from OpenSSL providers (Filip Skokan) #65484 * (SEMVER-MINOR) discover hashes from OpenSSL providers (Filip Skokan) #65484 doc: * deprecate `Server.prototype._listen2` in `node:net` (Antoine du Hamel) #65593 ffi: * (SEMVER-MINOR) enable module by default (Matteo Collina) #65475 lib: * (SEMVER-MINOR) implement node:bench (James M Snell) #65606 meta: * refine the security vuln posture for experimental features (James M Snell) #65438 perf_hooks: * (SEMVER-MINOR) implement Histogram meanCI API (James M Snell) #65606 * (SEMVER-MINOR) add CBOR export/import for histogram exchange (James M Snell) #65434 src: * (SEMVER-MINOR) let embedders supply a builtin code cache without a snapshot (Shelley Vohr) #65352 src,lib: * (SEMVER-MINOR) implement experimental DTLS API (James M Snell) #63182 vfs: * (SEMVER-MINOR) integrate with CJS and ESM module loaders (Matteo Collina) #63653 worker: * (SEMVER-MINOR) add support for Web Workers (Aviv Keller) #64894 PR-URL: #65881
Notable changes: crypto: * (SEMVER-MINOR) add a generic MAC API (Filip Skokan) #65553 * (SEMVER-MINOR) discover ciphers from OpenSSL providers (Filip Skokan) #65484 * (SEMVER-MINOR) discover hashes from OpenSSL providers (Filip Skokan) #65484 doc: * deprecate `Server.prototype._listen2` in `node:net` (Antoine du Hamel) #65593 ffi: * (SEMVER-MINOR) enable module by default (Matteo Collina) #65475 lib: * (SEMVER-MINOR) implement node:bench (James M Snell) #65606 meta: * refine the security vuln posture for experimental features (James M Snell) #65438 perf_hooks: * (SEMVER-MINOR) implement Histogram meanCI API (James M Snell) #65606 * (SEMVER-MINOR) add CBOR export/import for histogram exchange (James M Snell) #65434 src: * (SEMVER-MINOR) let embedders supply a builtin code cache without a snapshot (Shelley Vohr) #65352 src,lib: * (SEMVER-MINOR) implement experimental DTLS API (James M Snell) #63182 vfs: * (SEMVER-MINOR) integrate with CJS and ESM module loaders (Matteo Collina) #63653 worker: * (SEMVER-MINOR) add support for Web Workers (Aviv Keller) #64894 PR-URL: #65881
A new
node:benchmodule, modeled closely after thenode:testarchitecture.The core functionality is here but there are still improvements that are needed (see #65631). The focus was on minimal functionality, not absolutely optimal functionality. But this gives a solid starting point for improvements.
Architecturally, this is intended to be a minimal benchmark primitive. It's useful on it's own but provides a base set of primitives that more full-featured benchmark tools can build on. Specifically, this is not a full replacement for things like
bench-node, etc. It shouldn't be judged as such.