This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

core / knot2 / crates / knot-bench / benches / cob.rs
806 B 27 lines
1use divan::Bencher; 2use divan::counter::ItemsCount; 3use knot_bench::{ChangeCount, RepoCount, build_linear_cob, build_registry_checkpointed}; 4 5#[global_allocator] 6static ALLOC: divan::AllocProfiler = divan::AllocProfiler::system(); 7 8const GRADES: &[u32] = &[64, 512, 4096]; 9const REPO_GRADES: &[u64] = &[256, 1024, 4096]; 10 11fn main() { 12 divan::main(); 13} 14 15#[divan::bench(args = GRADES)] 16fn fold(bencher: Bencher, changes: u32) { 17 let cob = build_linear_cob(ChangeCount::new(changes)); 18 bencher 19 .counter(ItemsCount::new(changes as usize)) 20 .bench_local(|| cob.fold()); 21} 22 23#[divan::bench(args = REPO_GRADES)] 24fn registry_write_checkpointed(bencher: Bencher, repos: u64) { 25 let writer = build_registry_checkpointed(RepoCount::new(repos)); 26 bencher.bench_local(|| writer.probe()); 27}