lepture/mistune

Benchmark

lepture opened this issue · 2 comments

Read this: http://lepture.com/en/2014/markdown-parsers-in-python

Enable all features, without Cython.

Parsing the Markdown Syntax document 1000 times...
Mistune: 12.9425s
Misaka: 0.537176s
Markdown: 47.7091s
Markdown2: 80.5163s
cMarkdown: 0.680664s
Discount is not available

Parsing the Markdown Syntax document 1000 times...
Mistune: 12.7255s
Misaka: 0.553476s
Markdown: 47.9369s
Markdown2: 79.5075s
cMarkdown: 0.71733s
Discount is not available

With Cython

Parsing the Markdown Syntax document 1000 times...
Mistune: 9.78976s
Misaka: 0.528333s
Markdown: 46.3091s
Markdown2: 76.3403s
cMarkdown: 0.674922s
Discount is not available

Parsing the Markdown Syntax document 1000 times...
Mistune: 9.74075s
Misaka: 0.550502s
Markdown: 46.4342s
Markdown2: 78.2267s
cMarkdown: 0.664128s
Discount is not available

Benchmark with PyPy

Parsing the Markdown Syntax document 1000 times...
Mistune: 8.36888s
Misaka is not available
/Users/lepture/.venvs/pypy/site-packages/markdown/blockprocessors.py:151: FutureWarning: The behavior of this method will change in future versions.  Use specific 'len(elem)' or 'elem is not None' test instead.
  (len(parent) and parent[-1] and \
/Users/lepture/.venvs/pypy/site-packages/markdown/blockparser.py:94: FutureWarning: The behavior of this method will change in future versions.  Use specific 'len(elem)' or 'elem is not None' test instead.
  if processor.test(parent, blocks[0]):
Markdown: 30.9723s
Markdown2: 88.4563s
cMarkdown is not available
Discount is not available

Parsing the Markdown Syntax document 1000 times...
Mistune: 8.31194s
Misaka is not available
/Users/lepture/.venvs/pypy/site-packages/markdown/blockprocessors.py:151: FutureWarning: The behavior of this method will change in future versions.  Use specific 'len(elem)' or 'elem is not None' test instead.
  (len(parent) and parent[-1] and \
/Users/lepture/.venvs/pypy/site-packages/markdown/blockparser.py:94: FutureWarning: The behavior of this method will change in future versions.  Use specific 'len(elem)' or 'elem is not None' test instead.
  if processor.test(parent, blocks[0]):
Markdown: 31.6023s
Markdown2: 85.5509s
cMarkdown is not available
Discount is not available

https://github.com/lepture/mistune/blob/master/tests/bench.py

Parsing the Markdown Syntax document 1000 times...
Mistune: 9.676753
Misaka: 0.552392
Markdown: 46.059252
Markdown2: 77.199359
cMarkdown: 0.663649
Discount is not available
Hoep: 0.547027

#10

Did you try to benchmark with Numba ?