evanphx / benchmark-ips

Provides iteration per second benchmarking for Ruby
MIT License
1.72k stars 97 forks source link

Feat: Support JSON output to STDOUT #125

Closed okuramasafumi closed 1 year ago

okuramasafumi commented 1 year ago

I want to support benchmark-ips in github-action-benchmark. https://github.com/benchmark-action/github-action-benchmark

When it can write the result to STDOUT in JSON format, it would be easy to support it. This commits changes JSON output so that it can directly write to a given argument if it responds to write. It also adds tests and a section about JSON in README.

eregon commented 1 year ago

I think this is fine, although I would like someone else to review.

One note is becnhmarking on GitHub Actions and shared machines is probably most of the times not a good idea, because it's quite noisy. From that project's README, this seems very noisy indeed: https://benchmark-action.github.io/github-action-benchmark/dev/bench/

okuramasafumi commented 1 year ago

@eregon Although my primary motivation is to add github-action-benchmark, enabling JSON output to STDOUT is still useful to communicate to other tools.

nateberkopec commented 1 year ago

Was busy with Puma last week, I'll get to releasing this now :)

大倉さんありがとうございます!