diff --git a/pyperformance/data-files/benchmarks/MANIFEST b/pyperformance/data-files/benchmarks/MANIFEST index 3210b97f..19c9dc24 100644 --- a/pyperformance/data-files/benchmarks/MANIFEST +++ b/pyperformance/data-files/benchmarks/MANIFEST @@ -81,6 +81,7 @@ sqlglot_parse sqlglot_transpile sqlglot_optimize sqlite_synth +stdlib_startup sympy telco tomli_loads diff --git a/pyperformance/data-files/benchmarks/bm_stdlib_startup/pyproject.toml b/pyperformance/data-files/benchmarks/bm_stdlib_startup/pyproject.toml new file mode 100644 index 00000000..35f520bd --- /dev/null +++ b/pyperformance/data-files/benchmarks/bm_stdlib_startup/pyproject.toml @@ -0,0 +1,10 @@ +[project] +name = "pyperformance_stdlib_startup" +requires-python = ">=3.10" +dependencies = [] +urls = {repository = "https://github.com/python/pyperformance"} +dynamic = ["version"] + +[tool.pyperformance] +name = "stdlib_startup" +tags = "startup" diff --git a/pyperformance/data-files/benchmarks/bm_stdlib_startup/requirements.txt b/pyperformance/data-files/benchmarks/bm_stdlib_startup/requirements.txt new file mode 100644 index 00000000..e69de29b diff --git a/pyperformance/data-files/benchmarks/bm_stdlib_startup/run_benchmark.py b/pyperformance/data-files/benchmarks/bm_stdlib_startup/run_benchmark.py new file mode 100644 index 00000000..21f7269f --- /dev/null +++ b/pyperformance/data-files/benchmarks/bm_stdlib_startup/run_benchmark.py @@ -0,0 +1,29 @@ +import os +import sys +import subprocess +import tempfile + +import pyperf + +if __name__ == "__main__": + runner = pyperf.Runner(values=10) + + runner.metadata['description'] = "Performance of importing standard library modules" + args = runner.parse_args() + + with tempfile.TemporaryDirectory() as tmp: + main = os.path.join(tmp, "main.py") + with open(main, "w") as f: + f.write(""" +import importlib +import sys +for m in sys.stdlib_module_names: + if m in {"antigravity", "this"}: + continue + try: + importlib.import_module(m) + except ImportError: + pass +""") + command = [sys.executable, main] + runner.bench_command('stdlib_startup', command) pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy