summaryrefslogtreecommitdiffstats
path: root/profiler.py
blob: 414a772701b54639ae26be4a69d0f828ed2bf78a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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)