Rust library to generate static websites
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: only keep prefetch enabled in relevant benchmarks

+21 -6
+10 -2
benchmarks/md-benchmark/src/lib.rs
··· 1 1 use maudit::{ 2 - BuildOptions, 2 + BuildOptions, PrefetchOptions, PrefetchStrategy, 3 3 content::{UntypedMarkdownContent, glob_markdown}, 4 4 content_sources, coronate, routes, 5 5 }; ··· 9 9 let _ = coronate( 10 10 routes![page::Article], 11 11 content_sources!["articles" => glob_markdown::<UntypedMarkdownContent>(&format!("content/{}/*.md", markdown_count))], 12 - BuildOptions::default(), 12 + BuildOptions { 13 + prefetch: PrefetchOptions { 14 + // This benchmark is really about testing Maudit's Markdown rendering pipeline, if we enable prefetching then a lot of time 15 + // is spent in bundling, including the script in pages, etc. instead of that. It's still neat to see how much overhead prefetching adds, 16 + // but not really in this benchmark. 17 + strategy: PrefetchStrategy::None, 18 + }, 19 + ..Default::default() 20 + }, 13 21 ); 14 22 }
+9 -2
benchmarks/overhead/src/lib.rs
··· 1 - use maudit::{BuildOptions, content_sources, coronate, routes}; 1 + use maudit::{BuildOptions, PrefetchOptions, PrefetchStrategy, content_sources, coronate, routes}; 2 2 mod page; 3 3 4 4 pub fn build_website() { 5 5 let _ = coronate( 6 6 routes![page::Article], 7 7 content_sources![], 8 - BuildOptions::default(), 8 + BuildOptions { 9 + prefetch: PrefetchOptions { 10 + // This benchmark is really about testing Maudit's overhead, if we enable prefetching then a lot of time 11 + // is spent in bundling, including the script in pages, etc. instead of Maudit itself. 12 + strategy: PrefetchStrategy::None, 13 + }, 14 + ..Default::default() 15 + }, 9 16 ); 10 17 }
+1 -1
crates/maudit/Cargo.toml
··· 29 29 tokio = { version = "1", features = ["macros", "rt-multi-thread"] } 30 30 glob = "0.3.1" 31 31 syntect = "5.0" 32 - lol_html = "2.1.0" 32 + lol_html = "2.7.1" 33 33 slug = "0.1.6" 34 34 image = "0.25.6" 35 35 webp = "0.3.1"
+1 -1
crates/maudit/src/build/options.rs
··· 89 89 impl Default for PrefetchOptions { 90 90 fn default() -> Self { 91 91 Self { 92 - strategy: PrefetchStrategy::None, 92 + strategy: PrefetchStrategy::Tap, 93 93 } 94 94 } 95 95 }