Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34.2k
gh-138122: Add differential flame graph#145785
Open
ivonastojanovic wants to merge 2 commits intopython:mainfrom
Open
gh-138122: Add differential flame graph#145785ivonastojanovic wants to merge 2 commits intopython:mainfrom
ivonastojanovic wants to merge 2 commits intopython:mainfrom
Conversation
Differential flame graphs compare two profiling runs and highlight whereperformance has changed. This makes it easier to detect regressionsintroduced by code changes and to verify that optimizations have theintended effect.The visualization renders the current profile with frame widthsrepresenting current time consumption. Color is then applied to show thedifference relative to the baseline profile: red gradients indicateregressions, while blue gradients indicate improvements.Some call paths may disappear entirely between profiles. These arereferred to as elided stacks and occur when optimizations remove codepaths or when certain branches stop executing. When elided stacks arepresent, an "Elided" toggle is displayed, allowing the user to switchbetween the main differential view and a view showing only the removedpaths.
ContributorAuthor
ivonastojanovic commentedMar 10, 2026
I’m a bit stuck on what colors we should use for new vs deleted functions. Right now:
But I’m not sure if we should even treat them differently from other functions visually. From a perf perspective it’s kind of confusing:
So I’m not sure what the right visual semantics are here. Curious what you think 🙂 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading.Please reload this page.
Differential flame graphs compare two profiling runs and highlight where performance has changed. This makes it easier to detect regressions introduced by code changes and to verify that optimizations have the intended effect.
The visualization renders the current profile with frame widths representing current time consumption. Color is then applied to show the difference relative to the baseline profile: red gradients indicate regressions, while blue gradients indicate improvements.
Some call paths may disappear entirely between profiles. These are referred to as elided stacks and occur when optimizations remove code paths or when certain branches stop executing. When elided stacks are present, an "Elided" toggle is displayed, allowing the user to switch between the main differential view and a view showing only the removed paths.
Differential view

Elided view

CC:@pablogsal@lkollar
📚 Documentation preview 📚:https://cpython-previews--145785.org.readthedocs.build/