Performance
More Performance pages
Everything else tagged performance, grouped by section. Pages featured above are not repeated here.
Explanation
Sampling vs deterministic profilers: which should I use?
Sampling uses timer snapshots; deterministic hooks every call. Each suits different performance questions.
Which Python profiler should I use?
Choose between Python's built-in sampler, py-spy, Austin, Scalene, and Pyinstrument for CPU, memory, async, and native-code investigations.
Why is Python Slow?
Why Python is slower than compiled languages: dynamic type lookups, attribute resolution, and boxed values. When optimization matters.
Reference
Austin
Austin samples Python processes without code changes, with native stacks, asyncio task graphs, and profile queries for coding agents.
profiling.sampling
Python 3.15's profiling.sampling: statistical sampler for running processes. Attach by PID, output flame graphs or interactive HTML.
py-spy
py-spy is a low-overhead sampling profiler for Python that attaches to a running process without code changes or restarts.
Scalene
Scalene profiles Python CPU time, memory allocations, copying, and async waits by source line, with local reports and optional optimization suggestions.