-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat: add hooks in bench mode #7541
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
Conversation
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
I spoke with a team member in the Discord and they mentioned that windows tests are flaky, even in main. That's why it's marked as ready for review. |
|
Is this still in limbo with flaky Windows tests? My team is chomping at the bit to start using this. 🥺 |
I'll update the branch and see if there are still issues. |
|
Just to be clear, is this unrelated to https://tinylibs.github.io/tinybench/interfaces/FnOptions.html#beforeeach and https://tinylibs.github.io/tinybench/interfaces/FnOptions.html#aftereach which allows running code in every iteration that is not included in the total time? The FnOptions are crucial to allow measuring anything that has a large setup time like setting up a db or a file system before each iteration. |
So you're concerned that the current implementation of our Vitest hooks will are part of the execution time? I think it would in it's current state and I don't believe it's what is intended. I can fix. |
I was actually more concerned that we are not exposing the tinybench setup/teardown and how they can be exposed in a consistent manner to vitest bench tasks. |
@arv They're already exposed I believe, as the second parameter in a Vitest benchmark. Just forwards the object to TinyBench. Do you have a recommendation of how you'd imagine they should be exposed? |
|
Benchmarks being reimagined - I'll close this. |
|
@waynevanson is there a PR/issue I can follow? |
|
Yes @arv, github.com//discussions/7850 I've also created this package to run tests as benchmarks which is currently in development. |
Description
vitest bench.benchAPI #5075.Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yamlunless you introduce a new test example.Tests
pnpm test:ci.Documentation
pnpm run docscommand.Changesets
feat:,fix:,perf:,docs:, orchore:.