Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Markdown Performance Comparison 27
(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 randword() {return Math.random().toString(36).substring(2, 15)+" "} function mdf() { 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()].join("\n");} var mdff = mdf(); function md() {return mdff}
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 parsers is an essential task for software engineers, and MeasureThat.net provides a great platform for comparing various libraries. **What are we testing?** We're testing six different Markdown parsers: 1. Marked 2. CommonMark 3. Markdown-it 4. Remarkable 5. Micromarkdown 6. Snarkdown Each test case uses a predefined function `md()` that generates a random Markdown string, which is then passed to each parser for rendering or parsing. **Options compared** The options being compared are: * Rendering vs. parsing: Some parsers (Marked and Remarkable) render the Markdown text as HTML, while others (CommonMark and Micromarkdown) parse it into an abstract syntax tree (AST) that can be used for further processing. * HTML output: Parsers like Marked, Remarkable, Snarkdown, and Markdown-it generate HTML output, whereas CommonMark generates an AST. **Pros and cons of each approach** 1. **Rendering**: Pros: + Faster rendering times + Easier to use in GUI applications + Can be used with HTML rendering engines like WebGL or Three.js Cons: + May consume more memory due to temporary HTML storage + Less flexible than parsing ASTs 2. **Parsing (AST)**: Pros: * More flexible and customizable * Can be used for static site generation, code highlighting, or other downstream processing * Can be optimized for specific use cases Cons: * Slower rendering times compared to rendering * Requires more computational resources to generate the AST 3. **HTML output**: Pros: + Easy to integrate with existing web applications and frameworks + Can be used with standard HTML rendering libraries Cons: * May not be suitable for static site generation or other cases where parsing is preferred **Libraries and their purposes** 1. **Marked**: A popular, lightweight Markdown parser that renders the text as HTML. 2. **CommonMark**: An implementation of the CommonMark specification, which provides a standardized syntax for Markdown parsers. 3. **Markdown-it**: A flexible Markdown parser that can be used both for rendering and parsing. It's highly customizable and has a large ecosystem of plugins. 4. **Remarkable**: A fast and lightweight Markdown renderer that produces high-quality HTML output. It's designed for use in web applications and mobile apps. 5. **Micromarkdown**: A minimalistic Markdown parser that generates an AST, which can be used for further processing or static site generation. 6. **Snarkdown**: A lightweight Markdown parser that renders the text as HTML. **Special JavaScript features or syntax** This benchmark does not use any special JavaScript features or syntax, making it accessible to a wide range of software engineers. **Other alternatives** If you're interested in exploring other Markdown parsers or libraries, some notable alternatives include: * **Pandoc**: A powerful Markdown parser that can be used for static site generation, document conversion, and more. * **Mkdoc**: A lightweight Markdown parser designed for use in web applications and mobile apps. * **Katex**: A JavaScript library for rendering mathematical equations using MathJax or KaTeX. I hope this helps! Let me know if you have any further questions.
Related benchmarks:
Number vs + vs parseFloat
Math.floor(Math.random() * 1000000000).toString() vs window.performance.now().toFixed()
Regex vs Index vs StartsWith
Markdown Performance Comparison - DU
Markdown Performance Comparison 113
Comments
Confirm delete:
Do you really want to delete benchmark?