Crate criterion_table

Source
Expand description

Generate markdown comparison tables from Cargo Criterion benchmark JSON output.

Currently, the tool is limited to Github Flavored Markdown (GFM), but adding new output types is relatively simple.

§Generated Markdown Example

Benchmark Report

Modules§

formatter
This module holds the various formatters that can be used to format the output

Structs§

BenchmarkComplete
Raw deserialized JSON Criterion benchmark data
BenchmarkGroupComplete
Raw deserialized JSON Criterion benchmark group data
ColumnInfo
Column maximum width data
Comparison
A comparison time of a benchmark to its baseline
CriterionTableData
Fully processed Criterion benchmark data ready for formatting
TablesConfig
Configuration file format for adding comments to tables

Enums§

RawCriterionData
Enum that can hold either Raw deserialized JSON benchmark or benchmark group data
TimeUnit
Time unit of a particular measurement

Traits§

Formatter
Implement this “visitor” trait to create a Formatter for a new file type

Functions§

build_tables
Top level function that can be used to build table data. It takes a reader (raw cargo-criterion JSON data), a Formatter (only option is GFMFormatter as of this writing), and the name of a file in TablesConfig toml format (the file is optional, simply skipped if it can’t be found)