cpython/Lib/profiling/sampling
Pablo Galindo Salgado 661df25692
gh-149584: Fix excessive overhead in the Tachyon profiler regarding the cache behavior (#149649)
Use exact remote reads for interpreter state, thread state, and
interpreter frame structs instead of pulling full remote pages into the
profiler page cache. This matches the core change from
python/cpython#149585.

The profiler clears the page cache between samples, so live entries are
always packed at the front. Track the live count and only clear/search
that prefix instead of scanning all 1024 slots on the hot path.

Use the frame cache to predict the next thread state and top frame
address, then batch interpreter/thread/frame reads with process_vm_readv
when profiling a Linux target. Reuse prefetched frame buffers in the
frame walker when the prediction is valid.

Cache the last FrameInfo tuple per code object/instruction offset, reuse
cached thread id objects, and append cached parent frames directly on
full frame-cache hits. This cuts Python allocation churn in the
steady-state profiler path.
2026-05-20 04:32:08 -07:00
..
_assets gh-140727: Update tachyon logo (#148965) 2026-04-25 22:27:11 +01:00
_flamegraph_assets gh-142927: Show module names instead of file paths in flamegraph (#146040) 2026-04-29 10:00:07 +01:00
_heatmap_assets gh-149430: Fix edge-cases in profiling.sampling outputs (#149431) 2026-05-09 14:05:46 +01:00
_shared_assets gh-142927: Detect system theme in flame graph like in heatmap (#144885) 2026-03-10 13:38:48 +02:00
_vendor gh-135953: Add flamegraph reporter to sampling profiler (#138715) 2025-09-09 23:06:45 +01:00
live_collector gh-144384: Lazily import _colorize (#149318) 2026-05-06 16:07:43 +00:00
__init__.py gh-146256: Add --jsonl collector to the profiling.sampling (#146257) 2026-05-05 00:44:37 +00:00
__main__.py gh-142654: show the clear error message when sampling on an unknown PID in tachyon (#142655) 2025-12-17 14:15:22 +00:00
_child_monitor.py gh-138122: Replace --interval with --sampling-rate (#143085) 2025-12-24 13:46:33 +00:00
_css_utils.py gh-140677 Add heatmap visualization to Tachyon sampling profiler (#140680) 2025-12-02 20:33:40 +00:00
_format_utils.py gh-142927: Tachyon: Comma separate thousands and fix singular/plurals (#142934) 2025-12-22 14:15:57 +00:00
_sync_coordinator.py gh-143040: Exit taychon live mode gracefully and display profiled script errors (#143101) 2025-12-27 00:36:15 +00:00
binary_collector.py gh-138122: Allow tachyon to write and read binary output (#142730) 2025-12-22 23:57:20 +00:00
binary_reader.py gh-146256: Add --jsonl collector to the profiling.sampling (#146257) 2026-05-05 00:44:37 +00:00
cli.py gh-149430: Fix edge-cases in profiling.sampling outputs (#149431) 2026-05-09 14:05:46 +01:00
collector.py gh-149718: Aggregate same stack frames in Tachyon in some collectors (#149719) 2026-05-12 23:46:21 +00:00
constants.py gh-146256: Add --jsonl collector to the profiling.sampling (#146257) 2026-05-05 00:44:37 +00:00
dump.py gh-149296: Add dump subcommand to sampling profiler for one-shot stack snapshots (#149297) 2026-05-04 01:02:33 +01:00
errors.py gh-142654: show the clear error message when sampling on an unknown PID in tachyon (#142655) 2025-12-17 14:15:22 +00:00
gecko_collector.py gh-149718: Aggregate same stack frames in Tachyon in some collectors (#149719) 2026-05-12 23:46:21 +00:00
heatmap_collector.py gh-149718: Aggregate same stack frames in Tachyon in some collectors (#149719) 2026-05-12 23:46:21 +00:00
jsonl_collector.py gh-150034: Print JSONL filename when profiling finishes (#150035) 2026-05-20 04:29:48 -07:00
module_utils.py gh-142927: Show module names instead of file paths in flamegraph (#146040) 2026-04-29 10:00:07 +01:00
opcode_utils.py gh-138122: Make the tachyon profiler opcode-aware (#142394) 2025-12-11 03:41:47 +00:00
pstats_collector.py gh-149718: Aggregate same stack frames in Tachyon in some collectors (#149719) 2026-05-12 23:46:21 +00:00
sample.py gh-149584: Fix excessive overhead in the Tachyon profiler regarding the cache behavior (#149649) 2026-05-20 04:32:08 -07:00
stack_collector.py gh-149718: Aggregate same stack frames in Tachyon in some collectors (#149719) 2026-05-12 23:46:21 +00:00
string_table.py gh-135953: Reduce memory usage of stack collectors (#138875) 2025-09-14 23:47:14 +01:00