From 12e8343068b906f8b2afddc5569968a8a91fa5b0 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 29 Apr 2024 06:24:24 +0200 Subject: Adding upstream version 2.1.0. Signed-off-by: Daniel Baumann --- profiler.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 profiler.py (limited to 'profiler.py') diff --git a/profiler.py b/profiler.py new file mode 100644 index 0000000..414a772 --- /dev/null +++ b/profiler.py @@ -0,0 +1,19 @@ +"""A script for profiling. + +To generate and read results: + - `tox -e profile` + - `firefox .tox/prof/output.svg` +""" +from pathlib import Path + +from markdown_it import MarkdownIt + +commonmark_spec = ( + (Path(__file__).parent / "tests" / "test_cmark_spec" / "spec.md") + .read_bytes() + .decode() +) + +# Run this a few times to emphasize over imports and other overhead above +for _ in range(10): + MarkdownIt().render(commonmark_spec) -- cgit v1.2.3