Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Benchmark results

Peisar includes a repeatable Node.js benchmark that compares end-to-end Markdown-to-HTML rendering against:

  • marked
  • markdown-it
  • micromark with micromark-extension-gfm
  • showdown

The benchmark implementation lives in bench/src/index.js. Running it also regenerates benchmark-results.svg from the measured throughput and heap results.

What the benchmark measures

  • output validation before timing
  • throughput in operations per second
  • peak heap usage during repeated renders
  • three document sizes built from the same representative GFM input

The current benchmark suite uses:

  • Tinybench for timing
  • node --expose-gc for more stable memory measurements
  • Peisar 1.2.3 on Node.js 24.22.1 for the results below
  • micromark configured with its GFM syntax and HTML extensions
  • seven memory batches, with 100 / 25 / 10 render iterations per batch for base / medium / large documents
  • one base document plus medium-x8 and large-x32 expanded inputs

Throughput

Average throughput in operations per second (higher is better):

Scenariopeisarmarkedmarkdown-itshowdownmicromark
Base (528 B)20,5889,6537,8862,155901
Medium (4,542 B)2,6251,3291,001345111
Large (18,220 B)7233582618025

Average peak heap usage

Measured average peak heap in MiB (lower is better):

Scenariopeisarmarkedmarkdown-itshowdownmicromark
Base0.144.716.0720.2558.62
Medium0.239.5413.1850.7962.88
Large0.3515.2921.0163.8886.15

Summary

In the benchmark currently documented in this repository, Peisar had the highest measured throughput and lowest measured average peak heap usage across the tested scenarios, including micromark configured with GFM.

Notes

  • Results reflect the workload and configuration in bench/src/index.js.
  • Memory profiling uses seven batches with 100 / 25 / 10 iterations per batch for base / medium / large inputs; heap values are approximate and sensitive to the runtime and process state.
  • Benchmark results vary with runtime, hardware, input characteristics, and parser configuration.
  • Because this file lives in the repository rather than the published package metadata alone, it can be updated between releases.

Run the benchmark

From the repository root:

npm run benchmark

Or directly inside bench/:

cd bench
npm i
npm run bench