Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Markdown Performance Comparison 36
(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());
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 for developers and users alike. **Benchmark Overview** The provided benchmark compares the performance of six popular JavaScript Markdown libraries: marked, commonmark, markdown-it, remarkable, micromarkdown, and snarkdown. The benchmark consists of a single test case that generates a large amount of random Markdown text using the `md()` function. This text is then parsed and rendered by each library to produce HTML output. **Options Compared** The options being compared are: 1. **marked**: A lightweight Markdown parser and renderer. 2. **commonmark**: A full-fledged Markdown parser with advanced features like tables, definitions lists, and footnotes. 3. **markdown-it**: A minimalist Markdown parser with a focus on simplicity and ease of use. 4. **remarkable**: A high-performance Markdown renderer with support for advanced features like syntax highlighting. 5. **micromarkdown**: A compact and efficient Markdown parser that focuses on speed and size reduction. 6. **snarkdown**: A fast and feature-rich Markdown renderer that supports many advanced features. **Pros and Cons of Each Approach** Here's a brief summary of the pros and cons of each library: 1. **marked**: * Pros: Lightweight, easy to use, and fast. * Cons: Limited features compared to other libraries. 2. **commonmark**: * Pros: Comprehensive feature set, well-maintained, and widely used. * Cons: Larger size and slower performance compared to some other libraries. 3. **markdown-it**: * Pros: Simple and easy to use, fast, and lightweight. * Cons: Limited features and configuration options. 4. **remarkable**: * Pros: High-performance rendering, supports advanced features like syntax highlighting. * Cons: Steeper learning curve due to its custom API. 5. **micromarkdown**: * Pros: Fast and compact, ideal for resource-constrained environments. * Cons: Limited features and configuration options. 6. **snarkdown**: * Pros: Fast rendering, supports many advanced features like footnotes and syntax highlighting. * Cons: Larger size compared to some other libraries. **Library Usage** The benchmark uses each library as specified in the `Benchmark Definition` JSON, which defines how the test case is executed for each library. For example, the `marked` test case uses the `conv.marked(md())` function, while the `remarkable` test case uses `conv.remarkable.md()`. **Performance Results** The benchmark provides performance results for each library, measured in executions per second (EPS) on a Windows 10 system with Firefox 89. The results show that: * **micromarkdown** outperforms all other libraries in terms of speed and size. * **remarkable** is the fastest renderer among the Markdown libraries, but its performance comes at the cost of increased complexity. * **commonmark**, despite being larger and slower, offers a comprehensive feature set and is widely used. In conclusion, this benchmark provides a valuable comparison of six popular JavaScript Markdown libraries, highlighting their strengths and weaknesses. The results can help developers choose the best library for their specific use case, depending on performance, features, and size considerations.
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?