Rodrigo Girão Serrão: Module p... Note

Rodrigo Girão Serrão: Module profiling overview

Python 3.15 introduces a new standard library module named profiling. This module consolidates Python's built-in profiling tools under a single namespace. It provides access to two distinct profilers: Tachyon, a sampling profiler, and a tracing profiler. Tachyon, found in profiling.sampling, offers virtually zero overhead by using high-frequency sampling. The tracing profiler, located at profiling.tracing, deterministically profiles code by instrumenting it, though it incurs some overhead. Previously, Python had a deprecated pure-Python module called profile, which had limited practical utility. This old module is slated for removal in Python 3.17. The tracing profiler was formerly known as cProfile in Python 3.14 and earlier versions. This new profiling module aims to organize and modernize Python's profiling capabilities. The article serves as an introduction to these two key profilers.
CdXz5zHNQW_FgX6KQYd0y.webp