Replies: 4 comments
-
After some thinking I think it's a good idea to expose this function. I often work on optimizing one function for some extended periods of time and I don't care about anything else like the name of the suite, what is faster/slower, etc. I'm still not sure how to handle output modes though. Should I assume this is gonna be used only for quick and dirty testing purposes so it's always going to be something similar to Also when it comes to CLI (#5) I think it might be cool to have a file watcher and optionally re-run on every file change. But I guess this is a bit out of scope of this discussion. |
Beta Was this translation helpful? Give feedback.
-
Usually, people will use the benchmark to compare something with another thing, so adding one more API just for some rare cases I think don't worth the effort. If you make the suite API easier enough to be used and accept just one benchmark, I think it will cover the use cases of the people that want to benchmark just one function. |
Beta Was this translation helpful? Give feedback.
-
I'm reopening this since I think this is gonna be useful for benchmarking many different things that don't share the same domain so it doesn't make sense to put them into a suite. For example this is a good example of such a use case https://github.com/nodejs/node/blob/main/benchmark/assert/deepequal-buffer.js. Also if we think about #5 it's most likely gonna use such a function for running individual benchmark files. |
Beta Was this translation helpful? Give feedback.
-
I'm closing this in favor of #5. This is no longer needed. |
Beta Was this translation helpful? Give feedback.
-
Currently we can run benchmarks only inside of suites.
But sometime we might want to benchmark a single function and see the results. In such a case it's kind of meaningless to create a
Suite
and capture the results with modes likeuseTerminalCompact
that show the slowest/fastest.Do you think this would be useful?
(if yes please specify the use-cases)
Beta Was this translation helpful? Give feedback.
All reactions