Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Markdown Performance Comparison 31
(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 vs empty
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 randword() {return Math.random().toString(36).substring(2, 15)+" "} function md() { 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");} //var [md1, md2, md3, md4, md5, md6] = [md(), md(), md(), md(), md(), md()]
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());
empty
md()
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (7)
Previous results
Fork
Test case name
Result
Marked
CommonMark
Markdown-it
Remarkable
Micromarkdown
Snarkdown
empty
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 do my best to break down the provided benchmark and explain what's being tested, compared, and evaluated. **Benchmark Overview** The benchmark is designed to compare the performance of six different Markdown parsing libraries: Marked, CommonMark, Markdown-it, Remarkable, Micromarkdown, and Snarkdown. The test cases are designed to simulate real-world usage scenarios by generating a large amount of sample Markdown text (generated using the `md()` function) and measuring the time it takes for each library to parse and render the text. **Test Cases** There are two types of test cases: 1. **Library-specific tests**: Each library has its own test case, which involves calling the library's parsing function with the generated Markdown text as input. 2. **Empty test case**: This test case only measures the time it takes to execute an empty function (i.e., no parsing or rendering is performed). **Compared Options** The six libraries being compared are: 1. Marked 2. CommonMark 3. Markdown-it 4. Remarkable 5. Micromarkdown 6. Snarkdown Each library has its own strengths and weaknesses, which are reflected in the benchmark results. **Pros and Cons of Each Approach** Here's a brief overview of each library and their characteristics: 1. **Marked**: Fast and lightweight, but may not support all Markdown features. * Pros: Fast rendering, simple API. * Cons: Limited feature set, may require additional configuration. 2. **CommonMark**: Fast and widely supported, with a strong focus on simplicity. * Pros: Fast parsing, wide compatibility, simple API. * Cons: May not be as performant as Marked for very large inputs. 3. **Markdown-it**: Fast and feature-rich, with support for many Markdown extensions. * Pros: Comprehensive feature set, fast rendering, flexible configuration options. * Cons: Can be slower than CommonMark or Marked for simple cases. 4. **Remarkable**: Designed for performance and readability, with a focus on ease of use. * Pros: Fast parsing, easy to configure, high-quality documentation. * Cons: May not support all Markdown features or require additional setup. 5. **Micromarkdown**: Fast and lightweight, with a simple API and limited feature set. * Pros: Extremely fast rendering, minimal dependencies. * Cons: Limited feature set, may not be suitable for complex use cases. 6. **Snarkdown**: Designed for performance and ease of use, with support for many Markdown extensions. * Pros: Fast parsing, easy to configure, flexible configuration options. * Cons: May have slower rendering times compared to CommonMark or Marked. **Benchmark Results** The benchmark results show that each library performs differently depending on the specific test case. For example: * **empty test case**: Remarkable and Micromarkdown are significantly faster than the other libraries, likely due to their lightweight nature. * **library-specific tests**: + Marked is one of the fastest for simple cases (e.g., single-line Markdown text). + CommonMark is generally fast and consistent across most test cases. + Markdown-it is slightly slower but still performs well on complex cases. + Remarkable is faster than Micromarkdown, likely due to its more efficient rendering algorithm. Overall, the benchmark highlights the importance of choosing a library that balances performance, feature set, and ease of use for your specific use case.
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?