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

gh-150258: Show relative percentage on Tachyon flamegraph#150266
pablogsal merged 8 commits into
python:mainfrom
edvilme:tachyon-relative-percentage

Conversation

@edvilme
Copy link
Copy Markdown
Contributor

@edvilme edvilme commented May 22, 2026

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
Copy link
Copy Markdown

@scottshambaugh scottshambaugh left a comment

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
Copy link
Copy Markdown
Contributor Author

edvilme commented May 22, 2026

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

Thx for all the feedback! Glad it matches what you were looking for. I also think this will be useful! :)

Copy link
Copy Markdown
Member

@pablogsal pablogsal left a comment

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
Copy link
Copy Markdown

bedevere-app Bot commented May 23, 2026

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
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"

3 participants