Showdown.js vs Marked (v3)

Revision 3 of this benchmark created on


Preparation HTML

<script src="https://rawgithub.com/coreyti/showdown/master/src/showdown.js"></script>
<script src="https://rawgithub.com/chjj/marked/master/lib/marked.js"></script>
<script>
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"),

        showdownParser = new Showdown.converter().makeHtml,
        markedParserClear = marked;
  markedParserClear.setOptions({
                                gfm: false,
                                tables: false,
                                breaks: false,
                                pedantic: false,
                                sanitize: false,
                                smartLists: false,
                                smartypants: false
                        });
        markedParserGfm = marked;
  markedParserGfm.setOptions({
                                gfm: true,
                                tables: false,
                                breaks: false,
                                pedantic: false,
                                sanitize: false,
                                smartLists: false,
                                smartypants: false
                        });
        markedParserTables = marked;
  markedParserTables.setOptions({
                                gfm: false,
                                tables: true,
                                breaks: false,
                                pedantic: false,
                                sanitize: false,
                                smartLists: false,
                                smartypants: false
                        });
        markedParserBreaks = marked;
  markedParserBreaks.setOptions({
                                gfm: false,
                                tables: false,
                                breaks: true,
                                pedantic: false,
                                sanitize: false,
                                smartLists: false,
                                smartypants: false
                        });
        markedParserPedantic = marked;
  markedParserPedantic.setOptions({
                                gfm: false,
                                tables: false,
                                breaks: false,
                                pedantic: true,
                                sanitize: false,
                                smartLists: false,
                                smartypants: false
                        });
        markedParserSanitize = marked;
  markedParserSanitize.setOptions({
                                gfm: false,
                                tables: false,
                                breaks: false,
                                pedantic: false,
                                sanitize: true,
                                smartLists: false,
                                smartypants: false
                        });
        markedParserSmartLists = marked;
  markedParserSmartLists.setOptions({
                                gfm: false,
                                tables: false,
                                breaks: false,
                                pedantic: false,
                                sanitize: false,
                                smartLists: true,
                                smartypants: false
                        });
        markedParserSmartypants = marked;
  markedParserSmartypants.setOptions({
                                gfm: false,
                                tables: false,
                                breaks: false,
                                pedantic: false,
                                sanitize: false,
                                smartLists: false,
                                smartypants: true
                        });
        markedParserAll = marked;
  markedParserAll.setOptions({
                                gfm: true,
                                tables: true,
                                breaks: true,
                                pedantic: true,
                                sanitize: true,
                                smartLists: true,
                                smartypants: true
                        });
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Showdown.js
console.profile("showdown");
var html = showdownParser(md);
console.profileEnd();
ready
markedParserClear
console.profile("marked");
var html = markedParserClear(md);
console.profileEnd();
ready
markedParserGfm
console.profile("marked");
var html = markedParserGfm(md);
console.profileEnd();
ready
markedParserTables
console.profile("marked");
var html = markedParserTables(md);
console.profileEnd();
ready
markedParserBreaks
console.profile("marked");
var html = markedParserBreaks(md);
console.profileEnd();
ready
markedParserPedantic
console.profile("marked");
var html = markedParserPedantic(md);
console.profileEnd();
ready
markedParserSanitize
console.profile("marked");
var html = markedParserSanitize(md);
console.profileEnd();
ready
markedParserSmartLists
console.profile("marked");
var html = markedParserSmartLists(md);
console.profileEnd();
ready
markedParserSmartypants
console.profile("marked");
var html = markedParserSmartypants(md);
console.profileEnd();
ready
markedParserAll
console.profile("marked");
var html = markedParserAll(md);
console.profileEnd();
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