{"id":24373,"library":"pyperformance","title":"pyperformance - Python Benchmark Suite","description":"The official Python benchmark suite for CPython. Provides a collection of benchmarks used to measure and compare performance of Python versions and implementations. Current version is 1.14.0, with regular releases as CPython evolves. Requires Python >=3.10.","status":"active","version":"1.14.0","language":"python","source_language":"en","source_url":"https://github.com/python/pyperformance","tags":["benchmark","performance","cpython","testing"],"install":[{"cmd":"pip install pyperformance","lang":"bash","label":"Install pyperformance via pip"}],"dependencies":[{"reason":"Core dependency for running benchmarks and producing results.","package":"pyperf","optional":false}],"imports":[],"quickstart":{"code":"import subprocess\nimport sys\n\n# Run all benchmarks once\nsubprocess.run([sys.executable, '-m', 'pyperformance', 'run'], check=True)\n\n# Run a specific benchmark\nsubprocess.run([sys.executable, '-m', 'pyperformance', 'run', '--bench', 'crypto_pyaes'], check=True)","lang":"python","description":"Run pyperformance benchmarks from Python code using subprocess. For CLI usage, run `python -m pyperformance run` directly."},"warnings":[{"fix":"Use `subprocess.run(['python', '-m', 'pyperformance', 'run'])` or run the `pyperformance` command directly from the terminal.","message":"pyperformance is a CLI tool, not a library with importable modules. There is no `import pyperformance` for programmatic use; always invoke via subprocess or shell.","severity":"gotcha","affected_versions":"all"},{"fix":"Close all other applications, disable CPU scaling, and use `--strict` for reproducible results.","message":"Benchmark results are sensitive to machine state. Running with insufficient warmup or background processes can produce unreliable data.","severity":"gotcha","affected_versions":"all"},{"fix":"Upgrade to Python 3.10 or newer.","message":"Python 3.9 and earlier are no longer supported. Running on older Python may fail or produce errors.","severity":"deprecated","affected_versions":"<3.10"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Do not import pyperformance. Use `python -m pyperformance` or run the `pyperformance` command directly.","cause":"pyperformance is not a Python module that can be imported; it's a CLI tool.","error":"ModuleNotFoundError: No module named 'pyperformance'"},{"fix":"Use `--bench` or `--benchmarks` with a space: `pyperformance run --bench crypto_pyaes`.","cause":"Using an incorrect CLI syntax, e.g. `--bench=name` instead of `--bench name` or `--benchmarks name`.","error":"usage: pyperformance [-h] {run,list,show,compile} ...\npyperformance: error: unrecognized arguments: --bench=..."},{"fix":"Provide a positive integer to `--loops` (e.g., `--loops=5`) or omit the flag to let pyperformance decide.","cause":"Running with `--loops=0` or a negative value; pyperformance internally requires at least 1 loop.","error":"ValueError: The number of loops must be at least 1"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}