cpython/Lib/profiling/sampling/__init__.py
László Kiss Kollár 3e06cfcaee
gh-135953: Reduce memory usage of stack collectors (#138875)
The stack collector base class keeps all frames until export() is
called, which causes significant unnecessary memory usage. Instead, we
can process the frames on the fly in the collect call by dispatching the
aggregation logic to the subclass through the process_frames method.

Co-authored-by: Pablo Galindo Salgado <pablogsal@gmail.com>
2025-09-14 23:47:14 +01:00

12 lines
432 B
Python

"""Statistical sampling profiler for Python.
This module provides low-overhead profiling by periodically sampling the
call stack rather than tracing every function call.
"""
from .collector import Collector
from .pstats_collector import PstatsCollector
from .stack_collector import CollapsedStackCollector
from .string_table import StringTable
__all__ = ("Collector", "PstatsCollector", "CollapsedStackCollector", "StringTable")