Benchmarks

block-bq-flat

> the simple example of a blockquote 
> the simple example of a blockquote
> the simple example of a blockquote
> the simple example of a blockquote
... continuation
... continuation
... continuation
... continuation

empty blockquote:

>
>
>
>

commonmark.js x 21,447 ops/sec ±1.92% (90 runs sampled)
showdown.js x 7,487 ops/sec ±1.88% (94 runs sampled)
marked.js x 27,586 ops/sec ±5.48% (81 runs sampled)
markdown-it x 16,033 ops/sec ±1.01% (94 runs sampled)

block-bq-nested

>>>>>> deeply nested blockquote
>>>>> deeply nested blockquote
>>>> deeply nested blockquote
>>> deeply nested blockquote
>> deeply nested blockquote
> deeply nested blockquote

> deeply nested blockquote
>> deeply nested blockquote
>>> deeply nested blockquote
>>>> deeply nested blockquote
>>>>> deeply nested blockquote
>>>>>> deeply nested blockquote
commonmark.js x 14,343 ops/sec ±2.08% (96 runs sampled)
showdown.js x 1,901 ops/sec ±2.00% (97 runs sampled)
marked.js x 12,850 ops/sec ±0.86% (98 runs sampled)
markdown-it x 6,790 ops/sec ±1.34% (96 runs sampled)

block-code

        an
        example

        of



        a code
        block

commonmark.js x 64,060 ops/sec ±0.77% (98 runs sampled)
showdown.js x 21,942 ops/sec ±0.85% (98 runs sampled)
marked.js x 188,488 ops/sec ±2.20% (89 runs sampled)
markdown-it x 251,707 ops/sec ±1.23% (96 runs sampled)

block-fences

``````````text
an
example
```
of


a fenced
```
code
block
``````````

commonmark.js x 34,758 ops/sec ±0.76% (97 runs sampled)
showdown.js x 13,005 ops/sec ±0.94% (99 runs sampled)
marked.js x 199,835 ops/sec ±0.97% (96 runs sampled)
markdown-it x 151,714 ops/sec ±0.98% (95 runs sampled)

block-heading

# heading
### heading
##### heading

# heading #
### heading ###
##### heading \#\#\#\#\######

############ not a heading
commonmark.js x 19,113 ops/sec ±1.06% (99 runs sampled)
showdown.js x 8,958 ops/sec ±0.92% (97 runs sampled)
marked.js x 32,255 ops/sec ±1.00% (97 runs sampled)
markdown-it x 28,743 ops/sec ±2.62% (88 runs sampled)

block-hr

 * * * * *

 -  -  -  -  -

 ________


 ************************* text

commonmark.js x 29,835 ops/sec ±3.02% (92 runs sampled)
showdown.js x 19,546 ops/sec ±0.78% (98 runs sampled)
marked.js x 41,463 ops/sec ±1.02% (97 runs sampled)
markdown-it x 57,270 ops/sec ±2.92% (87 runs sampled)

block-html

<div class="this is an html block">

blah blah

</div>

<table>
  <tr>
    <td>
      **test**
    </td>
  </tr>
</table>

<table>

  <tr>

    <td>

      test

    </td>

  </tr>

</table>

<![CDATA[
  [[[[[[[[[[[... *cdata section - this should not be parsed* ...]]]]]]]]]]]
]]>

commonmark.js x 13,414 ops/sec ±0.85% (97 runs sampled)
showdown.js x 10,275 ops/sec ±0.69% (99 runs sampled)
marked.js x 7,057 ops/sec ±0.85% (99 runs sampled)
markdown-it x 17,183 ops/sec ±0.74% (98 runs sampled)

block-lheading

heading
---

heading
===================================

not a heading
----------------------------------- text
commonmark.js x 35,072 ops/sec ±0.74% (97 runs sampled)
showdown.js x 14,886 ops/sec ±1.59% (97 runs sampled)
marked.js x 50,852 ops/sec ±1.20% (96 runs sampled)
markdown-it x 31,350 ops/sec ±0.82% (92 runs sampled)

block-list-flat

 - tidy
 - bullet
 - list


 - loose

 - bullet

 - list


 0. ordered
 1. list
 2. example


 -
 -
 -
 -


 1.
 2.
 3.


 -  an example
of a list item
       with a continuation

    this part is inside the list

   this part is just a paragraph  


 1. test
 -  test
 1. test
 -  test


111111111111111111111111111111111111111111. is this a valid bullet?

 - _________________________

 - this
 - is

   a

   long
 - loose
 - list

 - with
 - some

   tidy

 - list
 - items
 - in

 - between
 - _________________________
commonmark.js x 3,500 ops/sec ±1.00% (98 runs sampled)
showdown.js x 1,330 ops/sec ±0.88% (95 runs sampled)
marked.js x 4,340 ops/sec ±0.85% (99 runs sampled)
markdown-it x 6,270 ops/sec ±0.92% (93 runs sampled)

block-list-nested

 - this
   - is
     - a
       - deeply
         - nested
           - bullet
             - list
   

 1. this
    2. is
       3. a
          4. deeply
             5. nested
                6. unordered
                   7. list


 - 1
  - 2
   - 3
    - 4
     - 5
      - 6
       - 7
      - 6
     - 5
    - 4
   - 3
  - 2
 - 1


 - - - - - - - - - deeply-nested one-element item

commonmark.js x 3,449 ops/sec ±0.78% (97 runs sampled)
showdown.js x 647 ops/sec ±1.43% (94 runs sampled)
marked.js x 3,527 ops/sec ±0.94% (98 runs sampled)
markdown-it x 6,519 ops/sec ±0.91% (98 runs sampled)

block-ref-flat

[1] [2] [3] [1] [2] [3]

[looooooooooooooooooooooooooooooooooooooooooooooooooong label]

 [1]: <http://something.example.com/foo/bar>
 [2]: http://something.example.com/foo/bar 'test'
 [3]:
 http://foo/bar
 [    looooooooooooooooooooooooooooooooooooooooooooooooooong   label    ]:
 111
 'test'
 [[[[[[[[[[[[[[[[[[[[ this should not slow down anything ]]]]]]]]]]]]]]]]]]]]: q
 (as long as it is not referenced anywhere)

 [[[[[[[[[[[[[[[[[[[[]: this is not a valid reference
commonmark.js x 4,197 ops/sec ±0.81% (94 runs sampled)
showdown.js x 7,098 ops/sec ±0.93% (97 runs sampled)
marked.js x 2,570 ops/sec ±0.98% (97 runs sampled)
markdown-it x 3,673 ops/sec ±0.95% (99 runs sampled)

block-ref-nested

[[[[[[[foo]]]]]]]

[[[[[[[foo]]]]]]]: bar
[[[[[[foo]]]]]]: bar
[[[[[foo]]]]]: bar
[[[[foo]]]]: bar
[[[foo]]]: bar
[[foo]]: bar
[foo]: bar

[*[*[*[*[foo]*]*]*]*]

[*[*[*[*[foo]*]*]*]*]: bar
[*[*[*[foo]*]*]*]: bar
[*[*[foo]*]*]: bar
[*[foo]*]: bar
[foo]: bar
commonmark.js x 3,518 ops/sec ±1.13% (94 runs sampled)
showdown.js x 8,977 ops/sec ±0.89% (97 runs sampled)
marked.js x 3,600 ops/sec ±1.30% (97 runs sampled)
markdown-it x 5,921 ops/sec ±1.63% (97 runs sampled)

inline-autolink

inline-backticks

`lots`of`backticks`

``i``wonder``how``this``will``be``parsed``
commonmark.js x 40,609 ops/sec ±1.03% (98 runs sampled)
showdown.js x 8,077 ops/sec ±0.83% (96 runs sampled)
marked.js x 35,378 ops/sec ±0.86% (98 runs sampled)
markdown-it x 49,370 ops/sec ±0.94% (97 runs sampled)

inline-em-flat

*this* *is* *your* *basic* *boring* *emphasis*

_this_ _is_ _your_ _basic_ _boring_ _emphasis_

**this** **is** **your** **basic** **boring** **emphasis**
commonmark.js x 9,303 ops/sec ±1.76% (95 runs sampled)
showdown.js x 14,591 ops/sec ±1.13% (97 runs sampled)
marked.js x 11,518 ops/sec ±0.84% (99 runs sampled)
markdown-it x 15,911 ops/sec ±0.91% (97 runs sampled)

inline-em-nested

*this *is *a *bunch* of* nested* emphases* 

__this __is __a __bunch__ of__ nested__ emphases__ 

***this ***is ***a ***bunch*** of*** nested*** emphases*** 
commonmark.js x 12,260 ops/sec ±1.04% (98 runs sampled)
showdown.js x 14,352 ops/sec ±0.99% (99 runs sampled)
marked.js x 14,257 ops/sec ±0.83% (96 runs sampled)
markdown-it x 14,922 ops/sec ±3.85% (93 runs sampled)

inline-em-worst

*this *is *a *worst *case *for *em *backtracking

__this __is __a __worst __case __for __em __backtracking

***this ***is ***a ***worst ***case ***for ***em ***backtracking
commonmark.js x 12,180 ops/sec ±1.70% (96 runs sampled)
showdown.js x 13,057 ops/sec ±0.68% (100 runs sampled)
marked.js x 14,101 ops/sec ±1.38% (96 runs sampled)
markdown-it x 8,949 ops/sec ±2.02% (96 runs sampled)

inline-entity

entities:

&nbsp; &amp; &copy; &AElig; &Dcaron; &frac34; &HilbertSpace; &DifferentialD; &ClockwiseContourIntegral;

&#35; &#1234; &#992; &#98765432;

non-entities:

&18900987654321234567890; &1234567890098765432123456789009876543212345678987654;

&qwertyuioppoiuytrewqwer; &oiuytrewqwertyuioiuytrewqwertyuioytrewqwertyuiiuytri;
commonmark.js x 11,800 ops/sec ±0.84% (96 runs sampled)
showdown.js x 8,926 ops/sec ±3.94% (87 runs sampled)
marked.js x 28,159 ops/sec ±0.95% (94 runs sampled)
markdown-it x 16,929 ops/sec ±0.75% (96 runs sampled)

inline-escape

\t\e\s\t\i\n\g \e\s\c\a\p\e \s\e\q\u\e\n\c\e\s

\!\\\"\#\$\%\&\'\(\)\*\+\,\.\/\:\;\<\=\>\?

\@ \[ \] \^ \_ \` \{ \| \} \~ \- \'

\
\\
\\\
\\\\
\\\\\

\<this\> \<is\> \<not\> \<html\>

commonmark.js x 9,450 ops/sec ±1.44% (95 runs sampled)
showdown.js x 6,331 ops/sec ±0.94% (97 runs sampled)
marked.js x 7,087 ops/sec ±0.94% (97 runs sampled)
markdown-it x 20,606 ops/sec ±1.08% (97 runs sampled)

inline-html

Taking commonmark tests from the spec for benchmarking here:

<a><bab><c2c>

<a/><b2/>

<a  /><b2
data="foo" >

<a foo="bar" bam = 'baz <em>"</em>'
_boolean zoop:33=zoop:33 />

<33> <__>

<a h*#ref="hi">

<a href="hi'> <a href=hi'>

< a><
foo><bar/ >

<a href='bar'title=title>

</a>
</foo >

</a href="foo">

foo <!-- this is a
comment - with hyphen -->

foo <!-- not a comment -- two hyphens -->

foo <?php echo $a; ?>

foo <!ELEMENT br EMPTY>

foo <![CDATA[>&<]]>

<a href="&ouml;">

<a href="\*">

<a href="\"">
commonmark.js x 4,780 ops/sec ±1.36% (97 runs sampled)
showdown.js x 2,641 ops/sec ±1.18% (95 runs sampled)
marked.js x 7,950 ops/sec ±0.65% (99 runs sampled)
markdown-it x 5,581 ops/sec ±1.02% (95 runs sampled)

inline-links-flat

inline-links-nested

inline-newlines

this\
should\
be\
separated\
by\
newlines

this  
should  
be  
separated  
by  
newlines  
too

this
should
not
be
separated
by
newlines

commonmark.js x 17,941 ops/sec ±0.86% (95 runs sampled)
showdown.js x 15,050 ops/sec ±0.77% (98 runs sampled)
marked.js x 17,909 ops/sec ±2.52% (93 runs sampled)
markdown-it x 23,644 ops/sec ±0.81% (95 runs sampled)

lorem1

Lorem ipsum dolor sit amet, __consectetur__ adipiscing elit. Cras imperdiet nec erat ac condimentum. Nulla vel rutrum ligula. Sed hendrerit interdum orci a posuere. Vivamus ut velit aliquet, mollis purus eget, iaculis nisl. Proin posuere malesuada ante. Proin auctor orci eros, ac molestie lorem dictum nec. Vestibulum sit amet erat est. Morbi luctus sed elit ac luctus. Proin blandit, enim vitae egestas posuere, neque elit ultricies dui, vel mattis nibh enim ac lorem. Maecenas molestie nisl sit amet velit dictum lobortis. Aliquam erat volutpat.

Vivamus sagittis, diam in [vehicula](https://github.com/markdown-it/markdown-it) lobortis, sapien arcu mattis erat, vel aliquet sem urna et risus. Ut feugiat sapien vitae mi elementum laoreet. Suspendisse potenti. Aliquam erat nisl, aliquam pretium libero aliquet, sagittis eleifend nunc. In hac habitasse platea dictumst. Integer turpis augue, tincidunt dignissim mauris id, rhoncus dapibus purus. Maecenas et enim odio. Nullam massa metus, varius quis vehicula sed, pharetra mollis erat. In quis viverra velit. Vivamus placerat, est nec hendrerit varius, enim dui hendrerit magna, ut pulvinar nibh lorem vel lacus. Mauris a orci iaculis, hendrerit eros sed, gravida leo. In dictum mauris vel augue varius, ac ullamcorper nisl ornare. In eu posuere velit, ac fermentum arcu. Interdum et malesuada fames ac ante ipsum primis in faucibus. Nullam sed malesuada leo, at interdum elit.

Nullam ut tincidunt nunc. [Pellentesque][1] metus lacus, commodo eget justo ut, rutrum varius nunc. Sed non rhoncus risus. Morbi sodales gravida pulvinar. Duis malesuada, odio volutpat elementum vulputate, massa magna scelerisque ante, et accumsan tellus nunc in sem. Donec mattis arcu et velit aliquet, non sagittis justo vestibulum. Suspendisse volutpat felis lectus, nec consequat ipsum mattis id. Donec dapibus vehicula facilisis. In tincidunt mi nisi, nec faucibus tortor euismod nec. Suspendisse ante ligula, aliquet vitae libero eu, vulputate dapibus libero. Sed bibendum, sapien at posuere interdum, libero est sollicitudin magna, ac gravida tellus purus eu ipsum. Proin ut quam arcu.

Suspendisse potenti. Donec ante velit, ornare at augue quis, tristique laoreet sem. Etiam in ipsum elit. Nullam cursus dolor sit amet nulla feugiat tristique. Phasellus ac tellus tincidunt, imperdiet purus eget, ullamcorper ipsum. Cras eu tincidunt sem. Nullam sed dapibus magna. Lorem ipsum dolor sit amet, consectetur adipiscing elit. In id venenatis tortor. In consectetur sollicitudin pharetra. Etiam convallis nisi nunc, et aliquam turpis viverra sit amet. Maecenas faucibus sodales tortor. Suspendisse lobortis mi eu leo viverra volutpat. Pellentesque velit ante, vehicula sodales congue ut, elementum a urna. Cras tempor, ipsum eget luctus rhoncus, arcu ligula fermentum urna, vulputate pharetra enim enim non libero.

Proin diam quam, elementum in eleifend id, elementum et metus. Cras in justo consequat justo semper ultrices. Sed dignissim lectus a ante mollis, nec vulputate ante molestie. Proin in porta nunc. Etiam pulvinar turpis sed velit porttitor, vel adipiscing velit fringilla. Cras ac tellus vitae purus pharetra tincidunt. Sed cursus aliquet aliquet. Cras eleifend commodo malesuada. In turpis turpis, ullamcorper ut tincidunt a, ullamcorper a nunc. Etiam luctus tellus ac dapibus gravida. Ut nec lacus laoreet neque ullamcorper volutpat.

Nunc et leo erat. Aenean mattis ultrices lorem, eget adipiscing dolor ultricies eu. In hac habitasse platea dictumst. Vivamus cursus feugiat sapien quis aliquam. Mauris quam libero, porta vel volutpat ut, blandit a purus. Vivamus vestibulum dui vel tortor molestie, sit amet feugiat sem commodo. Nulla facilisi. Sed molestie arcu eget tellus vestibulum tristique.

[1]: https://github.com/markdown-it
commonmark.js x 9,550 ops/sec ±0.99% (95 runs sampled)
showdown.js x 2,277 ops/sec ±0.90% (96 runs sampled)
marked.js x 6,624 ops/sec ±1.13% (96 runs sampled)
markdown-it x 6,616 ops/sec ±1.16% (98 runs sampled)

rawtabs

this is a test for tab expansion, be careful not to replace them with spaces

1	4444
22	333
333	22
4444	1


	tab-indented line
    space-indented line
	tab-indented line


a lot of                                                spaces in between here

a lot of												tabs in between here

commonmark.js x 18,045 ops/sec ±0.87% (99 runs sampled)
showdown.js x 6,864 ops/sec ±0.69% (99 runs sampled)
marked.js x 21,524 ops/sec ±0.75% (99 runs sampled)
markdown-it x 22,730 ops/sec ±0.96% (97 runs sampled)