Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Markdown–DOM Performance Comparison 11
(version: 0)
A performance comparison of leading Javascript Markdown implementations.
Comparing performance of:
Marked vs CommonMark vs Markdown-it-normal vs Remarkable vs Micromarkdown vs markdown-wasm vs markdown-wasm-normal vs markdown-it
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
new DOMParser(); conv.marked(md());
CommonMark
new DOMParser(); conv.cm.render(pars.cm.parse(md()));
Markdown-it-normal
new DOMParser(); conv.mdit.render(md());
Remarkable
new DOMParser(); conv.remarkable.render(md());
Micromarkdown
new DOMParser(); conv.micromarkdown.parse(md(),true);
markdown-wasm
var inp; try { inp = markdown.parse(md().substring(0,100)); } catch { inp = md().substring(0,100);} (new DOMParser()).parseFromString(inp, 'text/html');
markdown-wasm-normal
new DOMParser(); try { markdown.parse(md()); } catch {; }
markdown-it
(new DOMParser()).parseFromString(conv.mdit.render(md().substring(0,100)), 'text/html');
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (8)
Previous results
Fork
Test case name
Result
Marked
CommonMark
Markdown-it-normal
Remarkable
Micromarkdown
markdown-wasm
markdown-wasm-normal
markdown-it
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):
Let's dive into the world of Markdown parsers! **What is tested:** The benchmark measures the performance of various JavaScript libraries that implement Markdown parsing. Specifically, it tests how fast each library can parse and render Markdown text into HTML. **Options compared:** 1. **marked**: A popular Markdown parser library. 2. **commonmark**: Another widely-used Markdown parser library. 3. **markdown-it**: A lightweight Markdown parser library with some additional features. 4. **remarkable**: A Markdown parser library that's also a renderer. 5. **micromarkdown**: A fast and lightweight Markdown parser library. 6. **snarkdown**: A Markdown parser library with some limitations. 7. **markdown-wasm**: A WebAssembly (WASM) version of markdown.js, which is a JavaScript library for parsing Markdown text. **Pros and cons of each approach:** 1. **marked**: Pros: widely adopted, well-maintained; Cons: may not be the fastest option. 2. **commonmark**: Pros: highly customizable, fast; Cons: may require more code to set up. 3. **markdown-it**: Pros: lightweight, easy to use; Cons: may not support all Markdown features. 4. **remarkable**: Pros: does double duty as a renderer and parser; Cons: may be slower than other options. 5. **micromarkdown**: Pros: extremely fast, lightweight; Cons: may require more setup effort. 6. **snarkdown**: Pros: small footprint; Cons: limited features, compatibility issues. 7. **markdown-wasm**: Pros: WebAssembly version for improved performance and security; Cons: requires modern browsers and Node.js. **Observations from the benchmark results:** The results show that: * **micromarkdown** is the fastest option, with an average of 14,248 executions per second. * **remarkable** is a close second, with an average of 9,462 executions per second. * **markdown-it** is another fast option, with an average of 5,370 executions per second. * **marked** and **commonmark** are slightly slower, with averages of around 4,000-5,000 executions per second. * **snarkdown** is the slowest option, with an average of just over 1,400 executions per second. * **markdown-wasm** has a mixed performance, depending on the browser and device used. In conclusion, if speed is crucial, micromarkdown or remarkable might be the best choices. However, consider factors like compatibility, feature set, and ease of use when selecting a Markdown parser library for your project.
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?