bench: add experimental node:bench module - #65606
Conversation
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
|
Review requested:
|
Signed-off-by: James M Snell <jasnell@gmail.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #65606 +/- ##
==========================================
+ Coverage 90.06% 90.09% +0.02%
==========================================
Files 751 761 +10
Lines 254919 257177 +2258
Branches 48124 48613 +489
==========================================
+ Hits 229603 231697 +2094
- Misses 16492 16649 +157
- Partials 8824 8831 +7
🚀 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 |
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.