Browse Source

Fix benches

index-subcmd
Vincent Prouillet 5 years ago
parent
commit
a42e6dfec4
2 changed files with 146 additions and 147 deletions
  1. +142
    -144
      Cargo.lock
  2. +4
    -3
      components/site/benches/site.rs

+ 142
- 144
Cargo.lock
File diff suppressed because it is too large
View File


+ 4
- 3
components/site/benches/site.rs View File

@@ -43,7 +43,7 @@ fn bench_render_rss_feed(b: &mut test::Bencher) {
let tmp_dir = tempdir().expect("create temp dir"); let tmp_dir = tempdir().expect("create temp dir");
let public = &tmp_dir.path().join("public"); let public = &tmp_dir.path().join("public");
site.set_output_path(&public); site.set_output_path(&public);
b.iter(|| site.render_rss_feed(site.library.pages_values(), None).unwrap());
b.iter(|| site.render_rss_feed(site.library.read().unwrap().pages_values(), None).unwrap());
} }


#[bench] #[bench]
@@ -61,8 +61,9 @@ fn bench_render_paginated(b: &mut test::Bencher) {
let tmp_dir = tempdir().expect("create temp dir"); let tmp_dir = tempdir().expect("create temp dir");
let public = &tmp_dir.path().join("public"); let public = &tmp_dir.path().join("public");
site.set_output_path(&public); site.set_output_path(&public);
let section = site.library.sections_values()[0];
let paginator = Paginator::from_section(&section, &site.library);
let library = site.library.read().unwrap();
let section = library.sections_values()[0];
let paginator = Paginator::from_section(&section, &library);


b.iter(|| site.render_paginated(public, &paginator)); b.iter(|| site.render_paginated(public, &paginator));
} }


Loading…
Cancel
Save