Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Markdown Performance Comparison 37
(version: 0)
A performance comparison of leading Javascript Markdown implementations.
Comparing performance of:
Marked vs CommonMark vs Markdown-it vs Remarkable vs Micromarkdown vs Snarkdown
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 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() { var randword = Math.random().toString(36).substring(2, 15) + " "; return [randword, randword + randword, "## " + randword, "", "", "1. " + randword, "2. " + randword, "", "", "---", "", "***" + randword + "***", "", randword, randword + randword + randword + randword, randword + randword + randword + randword, randword, "", randword + randword + randword, randword, randword, randword, randword + randword + randword + randword, randword + randword + randword + randword, randword, "", randword + randword + randword, randword, randword, randword, randword + randword + randword + randword, randword + randword + randword + randword, randword, "", randword + randword + randword, randword, randword ].join("\n"); }
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);
Snarkdown
conv.snarkdown(md());
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
Snarkdown
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):
Measuring the performance of different Markdown implementations is an essential task, especially for applications that need to render and parse Markdown content. **Overview** The provided benchmark compares six Markdown libraries: Marked, CommonMark, Markdown-it, Remarkable, Micromarkdown, and Snarkdown. The test case uses a custom JavaScript function `md()` that generates a sample Markdown string with various elements (headers, lists, paragraphs, etc.). Each library is tested by rendering or parsing the same input Markdown string. **Library Overview** 1. **Marked**: A fast and lightweight Markdown parser and renderer. 2. **CommonMark**: A specification-based implementation of Markdown, aiming for maximum compatibility. 3. **Markdown-it**: A popular Markdown parser with various plugins for extensions (e.g., syntax highlighting). 4. **Remarkable**: A fast and flexible Markdown parser and renderer, designed for ease of use. 5. **Micromarkdown**: A lightweight Markdown parser with a focus on simplicity and performance. 6. **Snarkdown**: A high-performance Markdown parser and renderer. **Comparison** The test case measures the execution speed of each library in rendering or parsing the same input Markdown string. The results are presented as `ExecutionsPerSecond` values, indicating how many times the library can execute (render or parse) the input string per second. **Pros and Cons** 1. **Marked**: Fast, lightweight, and easy to use, but might not be as compatible with all Markdown syntax. 2. **CommonMark**: Highly compatible with the Markdown specification, but may be slower due to its complexity. 3. **Markdown-it**: Flexible with various plugins for extensions, but can be slower than other libraries due to plugin overhead. 4. **Remarkable**: Fast and easy to use, but might not be as compatible with all Markdown syntax. 5. **Micromarkdown**: Extremely lightweight and fast, but may lack features compared to other libraries. 6. **Snarkdown**: High-performance and flexible, but might require more configuration due to its complexity. **Other Considerations** * **Library Size**: The size of the library can affect loading times and overall performance. Micromarkdown is the smallest in terms of JavaScript file size. * **Syntax Compatibility**: Some libraries may not support all Markdown syntax elements or may have different parsing rules, which can impact compatibility and rendering quality. * **Plugin Support**: Libraries like Markdown-it offer plugin support, allowing developers to extend their functionality. **Alternatives** For those looking for alternatives to the tested libraries, consider: * **Hugo**: A popular static site generator that uses Markdown as its primary markup language. Hugo provides a fast and lightweight Markdown parser and renderer. * **StackEdit**: A web-based code editor that supports Markdown rendering with various plugins (e.g., syntax highlighting). Keep in mind that each library has its strengths and weaknesses, and the choice ultimately depends on specific requirements and preferences.
Related benchmarks:
Number vs + vs parseFloat
Number vs + vs parseInt
Math.floor(Math.random() * 1000000000).toString() vs window.performance.now().toFixed()
Markdown Performance Comparison - DU
Markdown Performance Comparison 113
Comments
Confirm delete:
Do you really want to delete benchmark?