Markdown Performance Comparison (v6)

Revision 6 of this benchmark created by Gio d'Amelio on


Description

A performance comparison of leading Javascript Markdown implementations.

Preparation HTML

<script type="text/javascript" src="https://rawgit.com/coreyti/showdown/master/src/showdown.js"></script>
<script type="text/javascript" src="https://rawgit.com/chjj/marked/master/lib/marked.js"></script>
<script type="text/javascript" src="http://spec.commonmark.org/js/commonmark.js"></script>
<script type="text/javascript" src="https://markdown-it.github.io/markdown-it.js"></script>

Setup

var md = [
                "# lol",
                "",
                "This is the **simplest** and **slickest** online Markdown editor.  ",
                "Just write Markdown and see what it looks like as you type. And convert it to HTML in one click.",
                "",
                "Getting started",
                "---------------",
                "",
                "### How?",
                "",
                "Just start typing in the left panel.",
                "",
                "### Buttons you might want to use",
                "",
                "- **Quick Reference**: that's a reminder of the most basic rules of Markdown",
                "- **HTML | Preview**: *HTML* to see the markup generated from your Markdown text, *Preview* to see how it looks like",
                "",
                "### Privacy",
                "",
                "- No data is sent to any server – everything you type stays in your browser",
                "- The editor automatically saves what yoyou accidentally close it.  ",
                "  If using a public computer, either empty the left panel before leaving the editor or use your browser's privacy mode",
                "",
                "---",
                "",
                "- No data is sent to any server – everything you type stays in your browser",
                "- The editor automatically saves what yoyou accidentally close it.  ",
                "  If using a public computer, either empty the left panel before leaving the editor or use your browser's privacy mode",
                "",
                "---",
                "",
                "This is the **simplest** and **slickest** online Markdown editor.  ",
                "Just write Markdown and see what it looks like as you type. And convert it to HTML in one click.Minimalist Online Markdown Editor",
                "=================================",
                "",
                "This is the **simplest** and **slickest** online Markdown editor.  ",
                "Just write Markdown and see what it looks like as you type. And convert it to HTML in one click.",
                "",
                "Getting started",
                "---------------",
                "",
                "### How?",
                "",
                "Just start typing in the left panel.",
                "",
                "### Buttons you might want to use",
                "",
                "- **Quick Reference**: that's a reminder of the most basic rules of Markdown",
                "- **HTML | Preview**: *HTML* to see the markup generated from your Markdown text, *Preview* to see how it looks like",
                "",
                "### Privacy",
                "",
                "- No data is sent to any server – everything you type stays in your browser",
                "- The editor automatically saves what yoyou accidentally close it.  ",
                "  If using a public computer, either empty the left panel before leaving the editor or use your browser's privacy mode",
                "",
                "---",
                "",
                "- No data is sent to any server – everything you type stays in your browser",
                "- The editor automatically saves what yoyou accidentally close it.  ",
                "  If using a public computer, either empty the left panel before leaving the editor or use your browser's privacy mode",
                "",
                "---",
                "",
                "This is the **simplest** and **slickest** online Markdown editor.  ",
                "Just write Markdown and see what it looks like as you type. And convert it to HTML in one click.Minimalist Online Markdown Editor",
                "=================================",
                "",
                "This is the **simplest** and **slickest** online Markdown editor.  ",
                "Just write Markdown and see what it looks like as you type. And convert it to HTML in one click.",
                "",
                "Getting started",
                "---------------",
                "",
                "### How?",
                "",
                "Just start typing in the left panel.",
                "",
                "### Buttons you might want to use",
                "",
                "- **Quick Reference**: that's a reminder of the most basic rules of Markdown",
                "- **HTML | Preview**: *HTML* to see the markup generated from your Markdown text, *Preview* to see how it looks like",
                "",
                "### Privacy",
                "",
                "- No data is sent to any server – everything you type stays in your browser",
                "- The editor automatically saves what yoyou accidentally close it.  ",
                "  If using a public computer, either empty the left panel before leaving the editor or use your browser's privacy mode",
                "",
                "---",
                "",
                "- No data is sent to any server – everything you type stays in your browser",
                "- The editor automatically saves what yoyou accidentally close it.  ",
                "  If using a public computer, either empty the left panel before leaving the editor or use your browser's privacy mode",
                "",
                "---",
                "",
                "This is the **simplest** and **slickest** online Markdown editor.  ",
                "Just write Markdown and see what it looks like as you type. And convert it to HTML in one click.Minimalist Online Markdown Editor",
                "=================================",
                "",
                "This is the **simplest** and **slickest** online Markdown editor.  ",
                "Just write Markdown and see what it looks like as you type. And convert it to HTML in one click.",
                "",
                "Getting started",
                "---------------",
                "",
                "### How?",
                "",
                "Just start typing in the left panel.",
                "",
                "### Buttons you might want to use",
                "",
                "- **Quick Reference**: that's a reminder of the most basic rules of Markdown",
                "- **HTML | Preview**: *HTML* to see the markup generated from your Markdown text, *Preview* to see how it looks like",
                "",
                "### Privacy",
                "",
                "- No data is sent to any server – everything you type stays in your browser",
                "- The editor automatically saves what yoyou accidentally close it.  ",
                "  If using a public computer, either empty the left panel before leaving the editor or use your browser's privacy mode",
                "",
                "---",
                "",
                "- No data is sent to any server – everything you type stays in your browser",
                "- The editor automatically saves what yoyou accidentally close it.  ",
                "  If using a public computer, either empty the left panel before leaving the editor or use your browser's privacy mode",
                "",
                "---",
                "",
                "This is the **simplest** and **slickest** online Markdown editor.  ",
                "Just write Markdown and see what it looks like as you type. And convert it to HTML in one click.Minimalist Online Markdown Editor",
                "=================================",
                "",
                "This is the **simplest** and **slickest** online Markdown editor.  ",
                "Just write Markdown and see what it looks like as you type. And convert it to HTML in one click.",
                "",
                "Getting started",
                "---------------",
                "",
                "### How?",
                "",
                "Just start typing in the left panel.",
                "",
                "### Buttons you might want to use",
                "",
                "- **Quick Reference**: that's a reminder of the most basic rules of Markdown",
                "- **HTML | Preview**: *HTML* to see the markup generated from your Markdown text, *Preview* to see how it looks like",
                "",
                "### Privacy",
                "",
                "- No data is sent to any server – everything you type stays in your browser",
                "- The editor automatically saves what yoyou accidentally close it.  ",
                "  If using a public computer, either empty the left panel before leaving the editor or use your browser's privacy mode",
                "",
                "---",
                "",
                "- No data is sent to any server – everything you type stays in your browser",
                "- The editor automatically saves what yoyou accidentally close it.  ",
                "  If using a public computer, either empty the left panel before leaving the editor or use your browser's privacy mode",
                "",
                "---",
                "",
                "This is the **simplest** and **slickest** online Markdown editor.  ",
                "Just write Markdown and see what it looks like as you type. And convert it to HTML in one click.Minimalist Online Markdown Editor",
                "=================================",
                "",
                "This is the **simplest** and **slickest** online Markdown editor.  ",
                "Just write Markdown and see what it looks like as you type. And convert it to HTML in one click.",
                "",
                "Getting started",
                "---------------",
                "",
                "### How?",
                "",
                "Just start typing in the left panel.",
                "",
                "### Buttons you might want to use",
                "",
                "- **Quick Reference**: that's a reminder of the most basic rules of Markdown",
                "- **HTML | Preview**: *HTML* to see the markup generated from your Markdown text, *Preview* to see how it looks like",
                "",
                "### Privacy",
                "",
                "- No data is sent to any server – everything you type stays in your browser",
                "- The editor automatically saves what yoyou accidentally close it.  ",
                "  If using a public computer, either empty the left panel before leaving the editor or use your browser's privacy mode",
                "",
                "---",
                "",
                "- No data is sent to any server – everything you type stays in your browser",
                "- The editor automatically saves what yoyou accidentally close it.  ",
                "  If using a public computer, either empty the left panel before leaving the editor or use your browser's privacy mode",
                "",
                "---",
                "",
                "This is the **simplest** and **slickest** online Markdown editor.  ",
                "Just write Markdown and see what it looks like as you type. And convert it to HTML in one click.Minimalist Online Markdown Editor",
                "=================================",
                "",
                "This is the **simplest** and **slickest** online Markdown editor.  ",
                "Just write Markdown and see what it looks like as you type. And convert it to HTML in one click.",
                "",
                "Getting started",
                "---------------",
                "",
                "### How?",
                "",
                "Just start typing in the left panel.",
                "",
                "### Buttons you might want to use",
                "",
                "- **Quick Reference**: that's a reminder of the most basic rules of Markdown",
                "- **HTML | Preview**: *HTML* to see the markup generated from your Markdown text, *Preview* to see how it looks like",
                "",
                "### Privacy",
                "",
                "- No data is sent to any server – everything you type stays in your browser",
                "- The editor automatically saves what yoyou accidentally close it.  ",
                "  If using a public computer, either empty the left panel before leaving the editor or use your browser's privacy mode",
                "",
                "---",
                "",
                "- No data is sent to any server – everything you type stays in your browser",
                "- The editor automatically saves what yoyou accidentally close it.  ",
                "  If using a public computer, either empty the left panel before leaving the editor or use your browser's privacy mode",
                "",
                "---",
                "",
                "This is the **simplest** and **slickest** online Markdown editor.  ",
                "Just write Markdown and see what it looks like as you type. And convert it to HTML in one click.Minimalist Online Markdown Editor",
                "=================================",
                "",
                "This is the **simplest** and **slickest** online Markdown editor.  ",
                "Just write Markdown and see what it looks like as you type. And convert it to HTML in one click.",
                "",
                "Getting started",
                "---------------",
                "",
                "### How?",
                "",
                "Just start typing in the left panel.",
                "",
                "### Buttons you might want to use",
                "",
                "- **Quick Reference**: that's a reminder of the most basic rules of Markdown",
                "- **HTML | Preview**: *HTML* to see the markup generated from your Markdown text, *Preview* to see how it looks like",
                "",
                "### Privacy",
                "",
                "- No data is sent to any server – everything you type stays in your browser",
                "- The editor automatically saves what yoyou accidentally close it.  ",
                "  If using a public computer, either empty the left panel before leaving the editor or use your browser's privacy mode",
                "",
                "---",
                "",
                "- No data is sent to any server – everything you type stays in your browser",
                "- The editor automatically saves what yoyou accidentally close it.  ",
                "  If using a public computer, either empty the left panel before leaving the editor or use your browser's privacy mode",
                "",
                "---",
                "",
                "This is the **simplest** and **slickest** online Markdown editor.  ",
                "Just write Markdown and see what it looks like as you type. And convert it to HTML in one click.",
                "",
                "- Unordered list item",
                "- Unordered list item",
                "",
                "First line.  ",
                "Second line.",
                "",
                "This is a link to [Google](http://www.google.com)",
                "",
                "First line.  ",
                "Second line.",
                "",
                "First line.  ",
                "Second line.",
                "",
                "First line.  ",
                "Second line.",
                "",
                "- Unordered list item",
                "- Unordered list item",
                "1. Ordered list item",
                "2. Ordered list item",
                "",
                "",
                "    /* This is a code block */",
                "",
                "    /* This is a code block */",
                "",
                "Let's talk about `<html>`!",
                "",
                "    /* This is a code block */",
                "",
                "![Valid XHTML](http://w3.org/Icons/valid-xhtml10)",
                "",
                "![Valid XHTML](http://w3.org/Icons/valid-xhtml10)",
                "",
                "```",
                "![Valid XHTML](http://w3.org/Icons/valid-xhtml10)",
                "```",
                "",
                "Let's talk about `<html>`!",
                "",
                "perform_complicated_task  ",
                "do_this_and_do_that_and_another_thing",
                "",
                "http://example.com",
                "",
                "~~Mistaken text.~~",
                "",
                "```ruby",
                "require 'redcarpet'",
                "markdown = Redcarpet.new(\"Hello World!\")",
                "puts markdown.to_html",
                "```",
                "",
                "| Left-Aligned  | Center Aligned  | Right Aligned |",
                "| :------------ |:---------------:| -----:|",
                "| col 3 is      | some wordy text | $1600 |",
                "| col 2 is      | centered        |   $12 |",
                "| zebra stripes | are neat        |    $1 |",
                "",
                "First Header  | Second Header",
                "------------- | -------------",
                "Content Cell  | Content Cell",
        "Content Cell  | Content Cell"
    ].join("\n")

Test runner

Ready to run.

Testing in
TestOps/sec
Showdown.js
var html = new Showdown.converter().makeHtml(md);
ready
Marked
var html = marked(md);
ready
Common Markdown
new commonmark.HtmlRenderer().render(new commonmark.DocParser().parse(md))
ready
Markdown It
new markdownit().render(md);
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.

  • Revision 2: published by Gio d'Amelio on
  • Revision 3: published on
  • Revision 4: published by Gio d'Amelio on
  • Revision 5: published by Gio d'Amelio on
  • Revision 6: published by Gio d'Amelio on
  • Revision 7: published by gegegerger on
  • Revision 10: published by Mihai Chereji on