35 performance close the gap to cmark 240µs → 150µs#44
Merged
tsunaminoai merged 3 commits intoMar 18, 2026
Hidden character warning
The head ref may contain hidden characters: "35-performance-close-the-gap-to-cmark-240\u00b5s-\u2192-150\u00b5s"
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #35
This pull request introduces significant improvements to the Markdown parser's benchmarking and parser combinator infrastructure. The main changes include a comprehensive rewrite and expansion of the performance benchmarking in both the
README.mdand the benchmarking script, as well as the addition of a newcombinators.zigmodule that encapsulates reusable parser combinators and convenience wrappers.Key changes:
Benchmarking and Documentation Improvements
README.mdto include new benchmarks for additional Markdown parsers (cmark,cmark-gfm), added a new memory usage table, and improved formatting and reproducibility instructions. [1] [2]flake.nixto:cmark,cmark-gfm), add memory usage (peak RSS) measurements, and split fast and slow tool benchmarking for improved accuracy.README.mdwith sorted, bolded tables for both speed and memory usage, and include the input file size. [1] [2] [3]Parser Infrastructure
src/markdown/combinators.zigmodule providing reusable Mecha-based parser combinators and convenience wrappers for block-level Markdown constructs (e.g., headings, lists, blockquotes, code fences, footnotes, indented code). This module improves code organization and reusability for the Markdown parsing logic.