···11# md-benchmark
2233-This crate contains a Maudit website with presets of various amount of markdown files and is used to benchmark the performance of Maudit.
33+This crate contains a Maudit website with presets of various amount of markdown files and is used to benchmark the performance of Maudit's Markdown rendering.
4455The generated Markdown files were taken from https://github.com/zachleat/bench-framework-markdown. Thanks to Zach Leatherman for providing the benchmark data and comparaison points with other static site generators.
66···32323333## Results
34343535-The following results were obtained on 2025-01-07 using a MacBook Pro (13-inch, M1, 2020) with 16 GB of RAM:
3535+The following results were obtained on 2025-08-27 using a MacBook Pro (13-inch, M1, 2020) with 16 GB of RAM:
36363737| Pages | Full Build Time (ms) |
3838| ----- | -------------------- |
3939-| 250 | 55 |
4040-| 500 | 113 |
4141-| 1000 | 253 |
4242-| 2000 | 504 |
4343-| 4000 | 922 |
3939+| 250 | 37 |
4040+| 500 | 75 |
4141+| 1000 | 151 |
4242+| 2000 | 319 |
4343+| 4000 | 676 |
44444545These numbers are not scientific and only serve as a rough estimate of the performance of Maudit. Your mileage may vary.
4646
+18-2
benchmarks/md-benchmark/benches/build.rs
···11use std::env;
22+use std::fs;
33+use std::path::Path;
2455+use divan::Bencher;
36use md_benchmark::build_website;
4758fn main() {
···1013}
11141215#[divan::bench(args = [250, 500, 1000, 2000, 4000], sample_count = 3)]
1313-fn full_build(markdown_count: u32) {
1414- build_website(markdown_count);
1616+fn full_build(bencher: Bencher, markdown_count: u32) {
1717+ bencher
1818+ .with_inputs(|| {
1919+ // Clear dist directory before each sample, otherwise later samples will either be very quick if we don't clean
2020+ // or very slow if we do. It's better to measure only the actual work being done. It's also closer to how it'd look like
2121+ // on platforms like Netlify or Vercel where the output directory is always cleaned before each build.
2222+ let dist_dir = Path::new("dist");
2323+ if dist_dir.exists() {
2424+ let _ = fs::remove_dir_all(dist_dir);
2525+ }
2626+ markdown_count
2727+ })
2828+ .bench_values(|markdown_count| {
2929+ build_website(markdown_count);
3030+ });
1531}
···48484949In general, if there's a compromise to be made, we prefer to optimize for developer experience over raw performance. However, we still aim to keep Maudit fast enough for most use cases.
50505151-On a 2020 M1 MacBook Pro, [we've found that the final binary of a Maudit project can build a project with 4000 Markdown files in a little over 900ms](https://github.com/bruits/maudit/tree/main/benchmarks/md-benchmark), which we consider quite reasonable.
5151+On a 2020 M1 MacBook Pro, [we've found that the final binary of a Maudit project can build a project with 4000 Markdown files in around 700ms](https://github.com/bruits/maudit/tree/main/benchmarks/md-benchmark), which we consider quite reasonable.
52525353-[](https://github.com/bruits/maudit/tree/main/benchmarks/md-benchmark)
5353+[](https://github.com/bruits/maudit/tree/main/benchmarks/md-benchmark)
54545555As we add more features, it's possible that Maudit will become slower, but we'll monitor performance and ensure that, yeah, it's reasonably fast.
5656