gh-150258: Show relative percentage on Tachyon flamegraph by edvilme · Pull Request #150266 · python/cpython · GitHub
Skip to content

gh-150258: Show relative percentage on Tachyon flamegraph - #150266

Merged
pablogsal merged 8 commits into
python:mainfrom
edvilme:tachyon-relative-percentage
May 23, 2026
Merged

pablogsal merged 8 commits into
python:mainfrom
edvilme:tachyon-relative-percentage

Conversation

@edvilme

@edvilme edvilme commented May 22, 2026

Copy link
Copy Markdown
Contributor

When running profiling, users rarely care about the global percentage of the runtime. Often, they want to select a function and measure child percentages relative to that.

This PR updates the flamegraph tooltips to show both "Percentage" and "Relative Percentage" when the user clicks a specific function.

Fixes #150258

Visualization

With no functions selected
image

With a function selected
image

Remarks

"Relative percentage" is only shown for the children of the selected node (<100%)

When running profiling, users rarely care about the global percentage of
the runtime. Often, they want to select a function and measure child
percentages relative to that.

This PR updates the flamegraph tooltips to show both "Percentage" and
"Relative Percentage" when the user clicks a specific function.

Fixes python#150258
Comment thread Lib/profiling/sampling/_flamegraph_assets/flamegraph.js
Comment thread Lib/profiling/sampling/_flamegraph_assets/flamegraph.js Outdated
Comment thread Lib/profiling/sampling/_flamegraph_assets/flamegraph.js Outdated

@scottshambaugh scottshambaugh left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally and this matches what I was looking for in the issue, thanks for putting this together!

@edvilme

edvilme commented May 22, 2026

Copy link
Copy Markdown
Contributor Author

@pablogsal pablogsal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks for the PR @edvilme

@pablogsal pablogsal added the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label May 23, 2026
@pablogsal
pablogsal merged commit fad0674 into python:main May 23, 2026
58 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @edvilme for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented May 23, 2026

Copy link
Copy Markdown

GH-150312 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label May 23, 2026
pablogsal pushed a commit that referenced this pull request May 23, 2026
…150266) (#150312)

gh-150258: Show relative percentage on Tachyon flamegraph (GH-150266)

When running profiling, users rarely care about the global percentage of
the runtime. Often, they want to select a function and measure child
percentages relative to that.

This PR updates the flamegraph tooltips to show both "Percentage" and
"Relative Percentage" when the user clicks a specific function.
(cherry picked from commit fad0674)

Co-authored-by: Eduardo Villalpando Mello <eduardovil@microsoft.com>
@bedevere-bot

Copy link
Copy Markdown

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Split "Percentage" in tachyon flamegraph tooltip UI to "Percentage of Root" and "Percentage of Selected"

4 participants