Skip to content

Commit

Permalink
Benchmark with all features
Browse files Browse the repository at this point in the history
  • Loading branch information
lepture committed Feb 25, 2014
1 parent 1d5a229 commit b7cbb6b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -16,3 +16,4 @@ cover/
*.bak
*.c
*.so
venv/
15 changes: 11 additions & 4 deletions tests/bench.py
Expand Up @@ -24,20 +24,27 @@ def benchmark_mistune(text):

@benchmark('misaka')
def benchmark_misaka(text):
import misaka
misaka.html(text)
import misaka as m
# mistune has all these features
extensions = (
m.EXT_NO_INTRA_EMPHASIS | m.EXT_FENCED_CODE | m.EXT_AUTOLINK |
m.EXT_TABLES | m.EXT_STRIKETHROUGH
)
md = m.Markdown(m.HtmlRenderer(), extensions=extensions)
md.render(text)


@benchmark('markdown2')
def benchmark_markdown2(text):
import markdown2
markdown2.markdown(text)
extras = ['code-friendly', 'fenced-code-blocks', 'footnotes']
markdown2.markdown(text, extras=extras)


@benchmark('markdown')
def benchmark_markdown(text):
import markdown
markdown.markdown(text)
markdown.markdown(text, ['extra'])


@benchmark('cMarkdown')
Expand Down

0 comments on commit b7cbb6b

Please sign in to comment.