-
Notifications
You must be signed in to change notification settings - Fork 46
Benchmarks
These are not rigorous benchmarks, but they are designed to get a sense of how omd
compares to other common Markdown-parsing tools.
The benchmark input that was used is the README of `markdown-it` (a popular Javascript markdown parser) concatenated to itself 100 times – resulting in a markdown file of 307K lines, good feature coverage, and denser markup usage than average.
Benchmark results (time + peak memory usage):
marked | markdown-it | omd 2.x | omd 1.x | pandoc -f markdown_strict |
1.30s (257Mio) | 1.99s (374Mio) | 0.73s (116Mio) | 4.73s (330Mio) | 33.99s (1870Mio) |
The results show that omd 2.x is competitive with state-of-the-art tools from the web community (it is faster and consumes less memory), omd 1.x was slower, and pandoc is sensibly slower. None of the implementations appear to make any effort to stream the input to reduce memory usage, which I guess is not worth it for typical short Markdown documents.
Details:
- [Markdown-it](https://github.com/markdown-it/markdown-it) is a popular Javascript Markdown parser, that was built to be extensible yet fast. I used the current master branch (7b8969c), run with node v10.8.0.
- [Marked](https://github.com/markedjs/marked) is a javascript implementation that was “built for speed”. I used the current master (c8783a3c), run with node v10.8.0.
- [Pandoc](https://github.com/jgm/pandoc) is a versatile format-conversion tool. I used version 2.9.2.1. Different markdown dialects supported by Pandoc have different parsing performance, so I used the simplest dialect, `markdown_strict`.
- The “omd 2.x” version (bc07ade77) is essentially the current master branch (December 2020).
- The “omd 1.x” version (9de620c) is a commit after the last 1.x release, the first I found that would compile fine on my machine.).