Add a full-document parse benchmark.

main
Tom Alexander 6 months ago
parent 7d73eb6bd4
commit 369d3e8c50
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

@ -14,7 +14,7 @@ function main {
additional_flags+=(--profile "$PROFILE")
fi
(cd "$DIR/../" && cargo build --no-default-features "${additional_flags[@]}")
perf record --freq=2000 --call-graph dwarf --output="$DIR/../perf.data" "$DIR/../target/${PROFILE}/parse" "${@}"
perf record --freq=70000 --call-graph dwarf --output="$DIR/../perf.data" "$DIR/../target/${PROFILE}/parse" "${@}"
# Convert to a format firefox will read
# flags to consider --show-info

@ -208,3 +208,17 @@ fn _document<'b, 'g, 'r, 's>(
},
))
}
#[cfg(test)]
mod tests {
use test::Bencher;
use super::*;
#[bench]
fn bench_full_document(b: &mut Bencher) {
let input = include_str!("../../org_mode_samples/element_container_priority/README.org");
b.iter(|| assert!(parse(input).is_ok()));
}
}

Loading…
Cancel
Save