2023-02-12 07:31:14 -05:00
|
|
|
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();
|
2023-03-19 13:44:58 -04:00
|
|
|
jotdown::html::Renderer::default()
|
2023-02-12 07:31:14 -05:00
|
|
|
.push(jotdown::Parser::new(bench_input::ALL), &mut s)
|
|
|
|
.unwrap();
|
|
|
|
s
|
|
|
|
}
|
|
|
|
|
|
|
|
iai::main!(block, block_inline, full);
|