-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
gh-140677 Add heatmap visualization to Tachyon sampling profiler #140680
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
b1d5307 to
9ee2b80
Compare
|
CC @ambv |
Introduce a new --heatmap output format that provides line-by-line execution visualization. The heatmap shows: - Color-coded execution intensity for each line (cold → warm → hot → very hot) - Inline sample counts and percentages per line - Per-file statistics (total samples, hottest line) - Interactive call graph navigation with caller/callee buttons - Module type badges (stdlib, site-packages, project code) Unlike flamegraphs which show call stacks and time distribution, heatmaps excel at identifying hot code paths within files, understanding line-level execution patterns, and navigating through call relationships.
savannahostrowski
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, this is so cool! I left a couple of comments, but also wanted to mention that I really loved that you added a minimap to show hotspots and the permalinking on line click; so nice for jumping around and sharing results.
|
CC @ivonastojanovic can you give this a pass when you have some time? Test it locally and play a bit with it before reviewing the code |
|
@ivonastojanovic I have updated the buttons to be toggles, pls take a look |
ivonastojanovic
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! I left a few comments, and I’ll experiment with the CSS a bit
| tree = trees[module_type] | ||
|
|
||
| # Project starts expanded, others start collapsed | ||
| is_collapsed = module_type in ('stdlib', 'site-packages') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the other files be collapsed by default? Since this category typically includes special frames or uncategorized files, users are usually more interested in their own project code first. Collapsing these by default might make navigation clearer?
Small changes: - Change navigation button colors for dark theme - Update toggle button colors and active-state text - Add missing "→" in the Intensity legend
|
@pablogsal I ran into a bug during testing, so with Total and Hot enabled, changing the theme makes the sidebar vanish 👀 Screen.Recording.2025-12-02.at.00.15.56.mov |
Co-authored-by: ivonastojanovic <[email protected]>
Good catch! Fixed :) |
ivonastojanovic
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
|
Thanks a lot @ivonastojanovic and @savannahostrowski for the reviews! |
python#140680) Co-authored-by: Ivona Stojanovic <[email protected]>
Introduce a new --heatmap output format that provides line-by-line
execution visualization. The heatmap shows:
Unlike flamegraphs which show call stacks and time distribution, heatmaps
excel at identifying hot code paths within files, understanding line-level
execution patterns, and navigating through call relationships.