Some more benches
This commit is contained in:
parent
5876a67100
commit
91adc03bdd
|
@ -87,3 +87,23 @@ fn bench_populate_sections_medium_kb(b: &mut test::Bencher) {
|
|||
|
||||
b.iter(|| site.populate_sections());
|
||||
}
|
||||
|
||||
#[bench]
|
||||
fn bench_render_markdown_small_blog(b: &mut test::Bencher) {
|
||||
let mut site = setup_site("small-blog");
|
||||
let tmp_dir = tempdir().expect("create temp dir");
|
||||
let public = &tmp_dir.path().join("public");
|
||||
site.set_output_path(&public);
|
||||
|
||||
b.iter(|| site.render_markdown());
|
||||
}
|
||||
|
||||
#[bench]
|
||||
fn bench_render_markdown_small_kb(b: &mut test::Bencher) {
|
||||
let mut site = setup_site("small-kb");
|
||||
let tmp_dir = tempdir().expect("create temp dir");
|
||||
let public = &tmp_dir.path().join("public");
|
||||
site.set_output_path(&public);
|
||||
|
||||
b.iter(|| site.render_markdown());
|
||||
}
|
||||
|
|
|
@ -260,7 +260,6 @@ impl Site {
|
|||
let config = &self.config;
|
||||
let base_path = &self.base_path;
|
||||
|
||||
// TODO: avoid the duplication with function above for that part
|
||||
// This is needed in the first place because of silly borrow checker
|
||||
let mut pages_insert_anchors = HashMap::new();
|
||||
for (_, p) in &self.pages {
|
||||
|
|
Loading…
Reference in a new issue