jotdown/bench/iai/main.rs
2023-02-14 21:51:23 +01:00

21 lines
481 B
Rust

use iai::black_box;
use jotdown::Render;
fn block() -> jotdown::Parser<'static> {
jotdown::Parser::new(black_box(bench_input::ALL))
}
fn block_inline() -> Option<jotdown::Event<'static>> {
black_box(jotdown::Parser::new(black_box(bench_input::ALL))).last()
}
fn full() -> String {
let mut s = String::new();
jotdown::html::Renderer
.push(jotdown::Parser::new(bench_input::ALL), &mut s)
.unwrap();
s
}
iai::main!(block, block_inline, full);