Show HN: Mitata – Benchmarking tooling for JavaScript (github.com)
I always had a sweet tooth for how easy it is to use google/benchmark, but when working with js, current libraries didn't feel right and some were not even accurate enough, so I decided to create my own library to make JavaScript benchmarking tooling better.
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.
26 comments
[ 4.2 ms ] story [ 69.9 ms ] threadedit: all JS is "headless". almost all languages are headless. _Software_ can be headless or have a GUI. but languages are naturally headless.
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
https://toolkit.pavi2410.me/tools/speedrun
https://github.com/pavi2410/toolkit/issues/8
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.
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
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!