Skip to content

35 performance close the gap to cmark 240µs → 150µs#44

Merged
tsunaminoai merged 3 commits into
mainfrom
35-performance-close-the-gap-to-cmark-240µs-→-150µs
Mar 18, 2026

Hidden character warning

The head ref may contain hidden characters: "35-performance-close-the-gap-to-cmark-240\u00b5s-\u2192-150\u00b5s"
Merged

35 performance close the gap to cmark 240µs → 150µs#44
tsunaminoai merged 3 commits into
mainfrom
35-performance-close-the-gap-to-cmark-240µs-→-150µs

Conversation

@sc2ben
Copy link
Copy Markdown
Contributor

@sc2ben sc2ben commented Mar 18, 2026

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.md and the benchmarking script, as well as the addition of a new combinators.zig module that encapsulates reusable parser combinators and convenience wrappers.

Key changes:

Benchmarking and Documentation Improvements

  • Expanded the performance section in README.md to include new benchmarks for additional Markdown parsers (cmark, cmark-gfm), added a new memory usage table, and improved formatting and reproducibility instructions. [1] [2]
  • Updated the benchmarking script in flake.nix to:
    • Benchmark more tools (cmark, cmark-gfm), add memory usage (peak RSS) measurements, and split fast and slow tool benchmarking for improved accuracy.
    • Automatically update the README.md with sorted, bolded tables for both speed and memory usage, and include the input file size. [1] [2] [3]

Parser Infrastructure

  • Added a new src/markdown/combinators.zig module 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.

@sc2ben sc2ben linked an issue Mar 18, 2026 that may be closed by this pull request
@tsunaminoai tsunaminoai added this to the V1.0.0 milestone Mar 18, 2026
@tsunaminoai tsunaminoai merged commit f48d9de into main Mar 18, 2026
2 checks passed
@tsunaminoai tsunaminoai deleted the 35-performance-close-the-gap-to-cmark-240µs-→-150µs branch March 18, 2026 21:43
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.

Performance: close the gap to cmark (~240µs → ~150µs)

2 participants