bench: add experimental node:bench module - #65606
Conversation
|
Review requested:
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #65606 +/- ##
==========================================
+ Coverage 90.07% 90.16% +0.08%
==========================================
Files 751 761 +10
Lines 254921 257394 +2473
Branches 48129 48686 +557
==========================================
+ Hits 229627 232068 +2441
- Misses 16479 16502 +23
- Partials 8815 8824 +9
🚀 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 |
Signed-off-by: James M Snell <jasnell@gmail.com> Assisted-by: Opencode
Signed-off-by: James M Snell <jasnell@gmail.com> Assisted-by: Opencode
Signed-off-by: James M Snell <jasnell@gmail.com> Assisted-by: Opencode
Signed-off-by: James M Snell <jasnell@gmail.com> Assisted-by: Opencode
Signed-off-by: James M Snel <jasnell@gmail.com> Assisted-by: Opencode
Signed-off-by: James M Snell <jasnell@gmail.com>
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
Signed-off-by: James M Snell <jasnell@gmail.com> Assisted-by: Opencode
Signed-off-by: James M Snell <jasnell@gmail.com> Assisted-by: Opencode
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 |
A new
node:benchmodule, modeled closely after thenode:testarchitecture.The core functionality is here but there are still improvements that are needed. Specifically, there's a fair amount of overhead interjected by the harness itself that can impact the results. The focus was on minimal functionality, not absolutely optimal functionality. But this gives a solid starting point for improvements.