https://github.com/bencheeorg/benchee_json
Benche formatter to output json
https://github.com/bencheeorg/benchee_json
benchee benchmarking formatter json plugin
Last synced: 6 months ago
JSON representation
Benche formatter to output json
- Host: GitHub
- URL: https://github.com/bencheeorg/benchee_json
- Owner: bencheeorg
- License: mit
- Created: 2016-08-04T11:31:31.000Z (almost 10 years ago)
- Default Branch: main
- Last Pushed: 2023-12-10T10:24:53.000Z (over 2 years ago)
- Last Synced: 2025-08-05T09:13:09.983Z (10 months ago)
- Topics: benchee, benchmarking, formatter, json, plugin
- Language: Elixir
- Size: 90.8 KB
- Stars: 6
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# benchee_json [](https://hex.pm/packages/benchee_json) [](https://hexdocs.pm/benchee_json/) [](https://github.com/bencheeorg/benchee_json/actions/workflows/main.yml) [](https://coveralls.io/github/bencheeorg/benchee_json?branch=main) [](https://hex.pm/packages/benchee_json) [](https://github.com/bencheeorg/benchee_json/blob/master/LICENSE)
Formats a benchee benchmarking suite to a JSON representation and can also write it to disk. Actively used in [benchee_html](https://github.com/PragTob/benchee_html) to generate JSON, and embed it into the JavaScript to give the JS access to the benchmarking results for graphing purposes.
## Installation
Add `:benchee_json` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:benchee_json, "~> 1.0", only: :dev}
]
end
```
## Usage
Like a normal benchee formatter:
```elixir
list = Enum.to_list(1..10_000)
map_fun = fn(i) -> [i, i * i] end
Benchee.run(%{
"flat_map" => fn -> Enum.flat_map(list, map_fun) end,
"map.flatten" => fn -> list |> Enum.map(map_fun) |> List.flatten end
},
formatters: [
{Benchee.Formatters.JSON, file: "my.json"},
Benchee.Formatters.Console
]
)
```
## Contributing
Contributions to `:benchee_json` are very welcome! Bug reports, documentation, spelling corrections, whole features, feature ideas, bugfixes, new plugins, fancy graphics... all of those (and probably more) are much appreciated contributions!
Please respect the [Code of Conduct](//github.com/PragTob/benchee_json/blob/master/CODE_OF_CONDUCT.md).
You can get started with a look at the [open issues](https://github.com/PragTob/benchee_json/issues).
A couple of (hopefully) helpful points:
* Feel free to ask for help and guidance on an issue/PR ("How can I implement this?", "How could I test this?", ...)
* Feel free to open early/not yet complete pull requests to get some early feedback
* When in doubt if something is a good idea open an issue first to discuss it
* In case I don't respond feel free to bump the issue/PR or ping me on other places
## Development
* `mix deps.get` to install dependencies
* `mix test` to run tests
* `mix credo` or `mix credo --strict` to find code style problems (not too strict with the 80 width limit for sample output in the docs)
## Copyright and License
Copyright (c) 2016 Tobias Pfeiffer
This library is released under the MIT License. See the [LICENSE.md](./LICENSE.md) file
for further details.