mitata icon indicating copy to clipboard operation
mitata copied to clipboard

Feature: write outputs to file and convert to markdown for tracking purpose

Open 0x4a61636f62 opened this issue 3 years ago • 1 comments

Thanks for a fantastic tool!

Is there a way to write the output to a file and convert it to a table in markdown with the performance measurements and dates executed? That would be helpful for app developers who are keen to track performance over time and conveniently be able to share the results across the team.

0x4a61636f62 avatar Sep 29 '22 14:09 0x4a61636f62

There is a way to output to files using the return value of run. I know this is way out of date, but thought it might be useful to anyone else looking into this.

My solution was to write a benchmark runner (using glob to find files to run with a **/*.bench.ts pattern by default) and have the runner write the reports from benchmarks to disk in version control. I only track the function contents for diffing, the avg, min...max, and p99 (personal choice, you can store whatever you want).

I have a command which runs all benchmarks but only outputs data about those which a) didn't exist before or b) have changed since they were last run. It could be tuned to be more efficient, but I don't have a way to target changed functions yet; I can only check if they changed after running them, at this point. I don't know if they changed until I get the report from mitata.

This is imperfect, it's fairly opinionated and specific to what I want, but the gist of it is that you can do this yourself fairly easily. With some effort I think a separate library could be created to manage and run mitata benchmarks, allowing common features like skipping and filtering by various methods. My sense at this point is that it would be out of scope to add these kinds of features to mitata.

steveadams avatar Jun 21 '23 04:06 steveadams