Crates.io | chairmark |
lib.rs | chairmark |
version | 0.1.0 |
source | src |
created_at | 2023-11-28 16:20:22.066845 |
updated_at | 2023-11-28 16:20:22.066845 |
description | benchmarking library without unstable stuff |
homepage | |
repository | https://github.com/Anonym234/chairmark |
max_upload_size | |
id | 1052129 |
size | 23,952 |
A benchmaking library in rust.
use chairmark::{chair, agg_and_cmp};
// custom function for sorting data
fn bubblesort(data: &mut Vec<u32>) {
/* your fancy sorting algorithm */
}
fn main() {
const RUNS: usize = 1_000;
let prepare = |_| (0u32..1_000).collect();
let bubblesort = chair_prepare(RUNS, prepare, |mut data| bubblesort(&mut data));
let std = chair_prepare(RUNS, prepare, |mut data| data.sort());
let compare = agg_and_cmp![std, bubblesort];
println!("{}", compare);
}