93 points · by evnwashere · 2y ago · 25 comments
With more free time, I finally implemented all features I wished for in 1.0.0 and made a lightweight C++ single-header version for moments when google/benchmark is too much.
Hope this library helps you as much as it does me.
in practice i haven’t found any js function that gets faster after mitata’s time budget (excluding cpu clock speed increasing because of continuous workload)
another problem is garbage collection can cause long pauses that cause big jumps for some runs, thus causing loop to continue searching for best result longer than necessary
As it processes input in batches, you can also use it in cases where you don't even need to load the whole input data in memory, if you chose so.
I’ve been using the `vitest bench` command; being able to slap a `.bench.ts` file next to a module and go to town is convenient: https://vitest.dev/guide/features.html#benchmarking
Very good work and design, glad to see a stable 1.0 is released!
I maintain this repo, and we hand roll the stats page, but if we could get that for free it’d be so great!
https://github.com/moltar/typescript-runtime-type-benchmarks
edit: all JS is "headless". almost all languages are headless. _Software_ can be headless or have a GUI. but languages are naturally headless.