glychee/benchmark
Contains custom types Function
and Data
and a runner function to run
a list of these benchmark functions against a list of benchmark data.
Types
Data pairs arbitrary data to benchmark on with a label.
The label is used as part of the benchmark’s stdout
output.
pub type Data(data) {
Data(label: String, data: data)
}
Constructors
-
Data(label: String, data: data)
Function pairs a label
with a function returning a callable.
The function requires some test_data
.
The label is used as part of the benchmark’s stdout output.
pub type Function(test_data, any) {
Function(label: String, callable: fn(test_data) -> fn() -> any)
}
Constructors
-
Function(label: String, callable: fn(test_data) -> fn() -> any)
Functions
pub fn run(
function_list: List(Function(a, b)),
data_list: List(Data(a)),
) -> Nil
Takes a List
of Function
and List
of Data
and runs benchmarks for each
Function
combined with each Data
grouped by Data
first and Function
second.
Utilizes Benchee
and its stdout
’s output to print the function’s benchmark
results for all data.