-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: benchmark #1029
feat: benchmark #1029
Conversation
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site settings. |
Let's discuss the design in #917 first. About benchmark.js, if we really end up using it, I could try to contact the author and see if our team could grant the access and help on maintaining it. |
It seems need to make benchmark( |
yes, It seems to had the same api with benchmark |
Published version 1.0.2 of tinybench. |
We already support the reporter interface to access the full test result. |
In fact, we had the results, but this style can't fill too much data 😁 |
…ommand is not benchmark
two decimal places will be rounded off. The real result is: 0.006637481844709122, 0.005769233822295151... |
I think we can native support deno style benchmark result. |
For ops/sec <1, should we display the duration of one op instead? |
maybe we can change ops/sec -> ops/ms |
I dont think, that ops/ms is that relevant. I personally run benchmarks multiple times because it also depends on which core you run the benchmark and if there is currently a heavier process running on it. So basically benchmarks only indicate if you have some heavy performance degredation. So I would think it is totally OK to have the ops/s. Also you have the percentage on how they differ, so you can actually see which one is faster. Is it possible to pass options to the benchmark like describe('sort', { minSample: 100 }, () => {
bench('normal', () => {
const x = [1, 5, 4, 2, 3]
x.sort((a, b) => {
return a - b
})
})
}) |
What do we need to release this? |
I would like to improve the default output to a table, but not blocking as we could improve it later. Since this is experimental, I think we could ship it in the next minor. |
3d4334f
to
c8603fa
Compare
fix #917
native support benchmark.
bench
command to start vitest and distinguish the current running mode of vitest (unit test or benchmark).bench
API to distinguish between unit test and benchmark and collect the benchmark execution function.Tinybench@2.1.3
as engine asynchronous multiple execution function.