Markdown parser fork with extended syntax for personal use.
at hack 24 lines 763 B view raw
1use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion}; 2use std::fs; 3 4fn readme(c: &mut Criterion) { 5 let doc = fs::read_to_string("readme.md").unwrap(); 6 7 c.bench_with_input(BenchmarkId::new("readme", "readme"), &doc, |b, s| { 8 b.iter(|| markdown::to_html(s)); 9 }); 10} 11 12// fn one_and_a_half_mb(c: &mut Criterion) { 13// let doc = fs::read_to_string("../a-dump-of-markdown/markdown.md").unwrap(); 14// let mut group = c.benchmark_group("giant"); 15// group.sample_size(10); 16// group.bench_with_input(BenchmarkId::new("giant", "1.5 mb"), &doc, |b, s| { 17// b.iter(|| markdown::to_html(s)); 18// }); 19// group.finish(); 20// } 21// , one_and_a_half_mb 22 23criterion_group!(benches, readme); 24criterion_main!(benches);