Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Markdown–DOM Performance Comparison 7
(version: 0)
A performance comparison of leading Javascript Markdown implementations.
Comparing performance of:
Marked vs CommonMark vs Markdown-it vs Remarkable vs Micromarkdown vs markdown-wasm
Created:
4 years ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script type="text/javascript" src="https://unpkg.com/marked@1.1.0/marked.min.js"></script> <script type="text/javascript" src="https://unpkg.com/commonmark@0.29.1/dist/commonmark.min.js"></script> <script type="text/javascript" src="https://unpkg.com/markdown-it@11.0.0/dist/markdown-it.min.js"></script> <script type="text/javascript" src="https://unpkg.com/remarkable@2.0.1/dist/remarkable.min.js"></script> <script type="text/javascript" src="https://unpkg.com/micromarkdown@0.3.0/dist/micromarkdown.min.js"></script> <script type="text/javascript" src="https://unpkg.com/snarkdown@1.2.2/dist/snarkdown.umd.js"></script> <script type="text/javascript" src="https://lukeuser.cacus.feralhosting.com/markdown.js"></script>
Script Preparation code:
var conv = { marked: marked, cm: new commonmark.HtmlRenderer(), mdit: markdownit({ html: true }), remarkable: new remarkable.Remarkable(), micromarkdown: window.micromarkdown, snarkdown: window.snarkdown, }; var pars = { cm: new commonmark.Parser() }; function md() { return "# The Static, Static Blog Generator\n\n### May 17th, 2014\n\nWe all like publishing our thoughts online - but why is it such a bother to run a CMS?\n\nManaging databases, updating software, and keeping track of our content often cuts into the most important activity: *expressing ourselves*.\n\nThe web makes it really easy to share our thoughts with millions of individuals from around the world." }
Tests:
Marked
conv.marked(md());
CommonMark
conv.cm.render(pars.cm.parse(md()));
Markdown-it
conv.mdit.render(md());
Remarkable
conv.remarkable.render(md());
Micromarkdown
conv.micromarkdown.parse(md(),true);
markdown-wasm
var inp; try { inp = markdown.parse(md()); } catch { inp = md();} (new DOMParser()).parseFromString(inp, 'text/html');
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (6)
Previous results
Fork
Test case name
Result
Marked
CommonMark
Markdown-it
Remarkable
Micromarkdown
markdown-wasm
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Autogenerated LLM Summary
(model
llama3.2:3b
, generated one year ago):
I'll break down the provided JSON and explain what's being tested, compared, and their pros and cons. **Benchmark Overview** The benchmark measures the performance of six different Markdown implementations: Marked, CommonMark, Markdown-it, Remarkable, Micromarkdown, and markdown-wasm. The test creates a sample Markdown text (`md`) and uses each implementation to render it into HTML. **Test Cases** Each test case represents a single Markdown implementation being tested for performance. The benchmark defines a script preparation code (`conv` object) that contains all the implementations to be compared. Each test case has a unique `Benchmark Definition` that specifies how the implementation is used: 1. **Marked**: `conv.marked(md())` * This is the original Marked library, which renders Markdown text directly. 2. **CommonMark**: `conv.cm.render(conv.pars.cm.parse(md()))` * CommonMark uses a parser to parse the Markdown text and then renders it using its own HTML renderer. 3. **Markdown-it**: `conv.mdit.render(md())` * Markdown-it is another popular Markdown library that renders Markdown text into HTML. 4. **Remarkable**: `conv.remarkable.render(md())` * Remarkable is a Markdown parser and renderer that uses a separate rendering engine for HTML output. 5. **Micromarkdown**: `conv.micromarkdown.parse(md(), true)` * Micromarkdown is a lightweight, fast Markdown implementation that also renders Markdown text into HTML. 6. **markdown-wasm**: `var inp; try { inp = markdown.parse(md()); } catch { inp = md();} (new DOMParser()).parseFromString(inp, 'text/html');` * This test case uses the Wasm version of markdown.js to parse and render Markdown text. **Comparison** Each implementation is compared using the same sample Markdown text (`md`). The benchmark measures the number of executions per second for each implementation. The results show which implementation performs best in terms of performance. **Pros and Cons** * **Marked**: Pros: Lightweight, fast rendering. Cons: Limited features. * **CommonMark**: Pros: Flexible parser, good support for complex Markdown syntax. Cons: Heavier than Marked due to the additional parsing step. * **Markdown-it**: Pros: Fast rendering, extensive library features. Cons: Larger footprint, more dependencies. * **Remarkable**: Pros: Robust feature set, separate rendering engine for HTML output. Cons: More complex architecture, slower rendering compared to lightweight options. * **Micromarkdown**: Pros: Lightweight, fast rendering, and compact size. Cons: Limited features, may require additional configuration for certain use cases. * **markdown-wasm**: Pros: Fast execution time, minimal dependencies. Cons: May have performance issues due to Wasm limitations. **Library Usage** The benchmark uses the following libraries: 1. `marked`: A lightweight Markdown rendering library. 2. `CommonMark`: A Markdown parser and renderer with a flexible architecture. 3. `Markdown-it`: A popular Markdown library with extensive features. 4. `Remarkable`: A robust Markdown parser and renderer with a separate HTML rendering engine. 5. `micromarkdown`: A lightweight, fast Markdown implementation. **Skip Preambles** Taking a deep breath...
Related benchmarks:
Markdown Performance Comparison 4
Markdown Performance Comparison 13
Markdown Performance Comparison 18
Markdown Performance Comparison 22
Markdown Performance Comparison 14
Comments
Confirm delete:
Do you really want to delete benchmark?