Repository navigation
Add a new heatmap output to the tachyon profiler #140677
Description
Activity
- addedtype-featureA feature request or enhancementA feature request or enhancementstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
on Oct 27, 2025 This is pretty cool. If I understand correctly, the heatmap output does not include the call stack info right? So if both A and B called C, we know how much time (samples) that each line of C takes, but we can't differentiate if they are consumed in A or B.
I'm not against this visualization I think it's very helpful, but as a future project, maybe we can combine the visualization.
So we can have a flamegraph be in half of the screen, then when we click a slice in that flamegraph, we show the corresponding function and how much time each line takes in that specific call stack.
This is pretty cool. If I understand correctly, the heatmap output does not include the call stack info right? So if both A and B called C, we know how much time (samples) that each line of C takes, but we can't differentiate if they are consumed in A or B.
It kind of does because the little arrow on the lines allow you to move between caller and caller. If there are many possible candidates a contextual menu is displayed so you can choose. We can also add how many samples every callee is associated with if we want to the menu or some other contextual info.
So we can have a flamegraph be in half of the screen, then when we click a slice in that flamegraph, we show the corresponding function and how much time each line takes in that specific call stack.
For all the research I have done I think is better to just separate these two (there is --flamegraph already) and this will be a separate output differently. It is possible to merge both but it makes things more complicated because the data needs to be processed in different ways.
- added a commit that references this issue
on Dec 2, 2025 - added a commit that references this issue
on Dec 6, 2025




It would be helpful to have a
--heatmapoutput format that shows line-by-line sample intensity, similar to coverage.py's HTML reports.Flamegraphs show which functions are hot and how they're called, but they don't tell you which lines within a function are the bottlenecks. The heatmap would solve this by showing the actual source code with color-coded lines (blue to red) based on sample counts, making it easy to spot hot loops, expensive operations, or unexpected hotspots within a function.
Usage would be:
python -m profiling.sampling --heatmap -o results script.pyLinked PRs