Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-138122: Add differential flame graph#145785

Open
ivonastojanovic wants to merge 2 commits intopython:mainfrom
ivonastojanovic:differential_flamegraph
Open

gh-138122: Add differential flame graph#145785
ivonastojanovic wants to merge 2 commits intopython:mainfrom
ivonastojanovic:differential_flamegraph

Conversation

@ivonastojanovic
Copy link
Contributor

@ivonastojanovicivonastojanovic commentedMar 10, 2026
edited by github-actionsbot
Loading

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
image

Elided view
image

CC:@pablogsal@lkollar


📚 Documentation preview 📚:https://cpython-previews--145785.org.readthedocs.build/

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.
@ivonastojanovicivonastojanovic changed the titleAdd differential flame graphgh-138122: Add differential flame graphMar 10, 2026
@ivonastojanovic
Copy link
ContributorAuthor

I’m a bit stuck on what colors we should use for new vs deleted functions.

Right now:

  • New functions (not in baseline, present in current) are purple.
  • Deleted functions (shown in elided view, were in baseline, gone in current) are deep red, mostly so they stand out and because red = “removed”.

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:

  • New functions are technically a regression (the code path now exists and adds cost).
  • Deleted ones are technically an improvement (code path removed).

So I’m not sure what the right visual semantics are here. Curious what you think 🙂

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@pablogsalpablogsalAwaiting requested review from pablogsalpablogsal is a code owner

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@ivonastojanovic

[8]ページ先頭

©2009-2026 Movatter.jp