benchee_html v0.4.0 Benchee.Formatters.HTML

Functionality for converting Benchee benchmarking results to an HTML page with plotly.js generated graphs and friends.

Examples

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.HTML.output/1,
    &Benchee.Formatters.Console.output/1
  ],
  formatter_options: [html: [file: "samples_output/flat_map.html"]],
)

Summary

Functions

Transforms the statistical results from benchmarking to html to be written somewhere, such as a file through IO.write/2

Combines format/1 and write/1 into a single convenience function that is also chainable (as it takes a suite and returns a suite)

Uses output of Benchee.Formatters.HTML.format/1 to transform the statistics output to HTML with JS, but also already writes it to files defined in the initial configuration under formatter_options: [html: [file: "benchmark_out/my.html"]]

Functions

format(suite)
format(Benchee.Suite.t) :: {%{optional(Benchee.Suite.key) => String.t}, map}

Transforms the statistical results from benchmarking to html to be written somewhere, such as a file through IO.write/2.

Returns a map from file name/path to file content along with formatter options.

output(suite)

Combines format/1 and write/1 into a single convenience function that is also chainable (as it takes a suite and returns a suite).

write(arg)
write({%{optional(Benchee.Suite.key) => String.t}, map}) :: :ok

Uses output of Benchee.Formatters.HTML.format/1 to transform the statistics output to HTML with JS, but also already writes it to files defined in the initial configuration under formatter_options: [html: [file: "benchmark_out/my.html"]].

Generates the following files:

  • index file (exactly like file is named)
  • a comparison of all the benchmarked jobs (one per benchmarked input)
  • for each job a detail page with more detailed run time graphs for that particular job (one per benchmark input)