Skip to content

Conversation

@kivikakk
Copy link
Owner

Turns out process_line will pretty much duplicate every line fed to it — we avoid including the actual line ending character in feed, but then process_line demands its input ends in one!

This results in a ~1.12x speed-up on the benchmark document. Yippee. Documents with CRLF line actually already ran about as fast — they get a more modest 1.05x speed-up.

@github-actions
Copy link
Contributor

Command Mean [ms] Min [ms] Max [ms] Relative
./bench.sh ./comrak-38ebabf 113.5 ± 0.9 112.0 115.8 1.99 ± 0.03
./bench.sh ./comrak-main 128.2 ± 10.8 124.5 180.0 2.25 ± 0.19
./bench.sh ./pulldown-cmark 57.0 ± 0.8 56.1 59.5 1.00
./bench.sh ./cmark-gfm 86.9 ± 8.1 80.3 104.0 1.52 ± 0.14
./bench.sh ./markdown-it 250.3 ± 2.4 244.5 256.5 4.39 ± 0.07

Run on Sun Oct 19 02:11:47 UTC 2025

@kivikakk kivikakk merged commit 0b61547 into main Oct 19, 2025
45 checks passed
@kivikakk kivikakk deleted the push-nxykntuknupw branch October 19, 2025 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants