File: profiler_script.py

package info (click to toggle)
python-tomli 2.2.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,208 kB
  • sloc: python: 1,129; makefile: 7
file content (18 lines) | stat: -rw-r--r-- 395 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"""A script for profiling.

To generate and read results:
  - `tox -e profile`
  - `firefox .tox/prof/output.svg`
"""

from pathlib import Path

import tomli

benchmark_toml = (
    (Path(__file__).parent.parent / "benchmark" / "data.toml").read_bytes().decode()
)

# Run this a few times to emphasize over imports and other overhead above.
for _ in range(1000):
    tomli.loads(benchmark_toml)