benchee_json Hex VersionBuild StatusCoverage Status

Formats a benchee benchmarking suite to a JSON representation and can also write it to disk. Actively used in 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:

def deps do
  [{:benchee_json, "~> 0.4", only: :dev}]
end

Usage

Like a normal benchee formatter:

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.

You can get started with a look at the open issues.

A couple of (hopefully) helpful points:

Development