From b7cbb6bf2732c54998c6767df658cb406d1cdfc7 Mon Sep 17 00:00:00 2001 From: Hsiaoming Yang Date: Tue, 25 Feb 2014 16:46:19 +0800 Subject: [PATCH] Benchmark with all features --- .gitignore | 1 + tests/bench.py | 15 +++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 1e588c6..cbfc98e 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ cover/ *.bak *.c *.so +venv/ diff --git a/tests/bench.py b/tests/bench.py index 0a51b72..9ca3414 100644 --- a/tests/bench.py +++ b/tests/bench.py @@ -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')