# Benchmark
An HTML-to-Markdown benchmark for htmd-cli, [Turndown.js](https://github.com/mixmark-io/turndown) and [Pandoc](https://github.com/jgm/pandoc).
### What does it do?
- Fetch 200 page links from [Wikipedia - Rust]()
- Fetch all 200 pages and save them as HTML files
- Bench using [hyperfine](https://github.com/sharkdp/hyperfine) and following command:
```
hyperfine --warmup 3 --runs 5 \
'cargo run --release -- ./bench/bench-pages -o ./bench/bench-out/htmd' \
'bun bench/turndownCli.ts ./bench/bench-pages' \
'bun bench/pandocBatchCli.ts ./bench/bench-pages'
```
# Environment
System: linux x64 #23~22.04.1-Ubuntu SMP Thu May 9 17:59:24 UTC 2024
CPUs: AMD EPYC 7763 64-Core Processor x 4
Memory: 15.6 GB
# Versions
Bun: 1.1.17
Hyperfine: 1.18.0
htmd-cli: 0.3.3
Turndown.js: 7.2.0
Pandoc: 3.2
# Inputs
File count: 200
Total size: 61.84 MB
# Results
```
Benchmark 1: cargo run --release -- ./bench/bench-pages -o ./bench/bench-out/htmd
Time (mean ± σ): 899.9 ms ± 4.0 ms [User: 3117.6 ms, System: 192.0 ms]
Range (min … max): 893.0 ms … 902.5 ms 5 runs
Benchmark 2: bun bench/turndownCli.ts ./bench/bench-pages
Time (mean ± σ): 11.616 s ± 0.340 s [User: 13.380 s, System: 0.791 s]
Range (min … max): 11.166 s … 12.111 s 5 runs
Benchmark 3: bun bench/pandocBatchCli.ts ./bench/bench-pages
Time (mean ± σ): 42.064 s ± 0.614 s [User: 145.672 s, System: 18.846 s]
Range (min … max): 41.487 s … 43.056 s 5 runs
Summary
cargo run --release -- ./bench/bench-pages -o ./bench/bench-out/htmd ran
12.91 ± 0.38 times faster than bun bench/turndownCli.ts ./bench/bench-pages
46.74 ± 0.71 times faster than bun bench/pandocBatchCli.ts ./bench/bench-pages
```
*Updated at Thu, 27 Jun 2024 06:39:38 GMT*
*Generated by [bench.ts](bench.ts)*