-
Notifications
You must be signed in to change notification settings - Fork 329
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
bench: change the benchmark tool from vitest
to tinybench
#710
Open
dayongkr
wants to merge
19
commits into
toss:main
Choose a base branch
from
dayongkr:tinybench
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Update .gitignore to include .bench-bundle file - Add new script .scripts/bench-runner.mjs for running benchmarks - Update benchmarks/package.json to add devDependencies - Add new benchmark file benchmarks/performance/bench.ts - Update package.json to add new devDependencies - Update rollup.config.mjs to export entrypoints - Update yarn.lock to add new devDependencies
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
dayongkr
changed the title
bench: Change the benchmark tool from
bench: change the benchmark tool from Oct 14, 2024
vitest
to tinybench
vitest
to tinybench
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #710 +/- ##
=======================================
Coverage 99.03% 99.03%
=======================================
Files 285 285
Lines 2483 2483
Branches 706 706
=======================================
Hits 2459 2459
Misses 23 23
Partials 1 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Vitest
introduces overhead fromvite
, which significantly impacts functions in utility tools with low computation, making it unsuitable fores-toolkit
.To address this, I implemented benchmarking using only tinybench. The process works as follows:
bench-runner.mjs
script is triggered.benchmarks/performance
to determine which files to benchmark.rollup
and stored in the.bench-bundle
folder.node <built-file>
.Additionally, to maintain the usability of
vitest
, I implemented the samedescribe
andbench
interface in thebenchmark/bench.ts
file.The main differences are that, instead of importing from
vitest
, the functions are now imported from../bench
, and the output is somewhat simpler. Other than that, commands are executed the same way, such asyarn bench chunk
.I’m sorry for opening such a large PR.🙏 If there are any questions or concerns, ask for a review at any time.
TODO
es-toolkit
and a benchmark filetinybench
to have the same interface asvitest
for convenient writing of benchmark code