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

Appearance settings

gh-142927: Fix inverted flamegraph width#148568

Merged
pablogsal merged 1 commit into
python:mainpython/cpython:mainfrom
ivonastojanovic:inverted_flamegraph_widthivonastojanovic/cpython:inverted_flamegraph_widthCopy head branch name to clipboard
Apr 28, 2026
Merged

gh-142927: Fix inverted flamegraph width#148568
pablogsal merged 1 commit into
python:mainpython/cpython:mainfrom
ivonastojanovic:inverted_flamegraph_widthivonastojanovic/cpython:inverted_flamegraph_widthCopy head branch name to clipboard

Conversation

@ivonastojanovic

Copy link
Copy Markdown
Contributor

The inverted view used thread presence as a proxy for self time. This missed self samples on C-level wrapper frames like _run_code, where the node's thread always appears in its children too. Those samples were silently dropped, causing the chart to render narrower than full width. Now uses the explicit self field on each node instead of the thread heuristic.

CC: @pablogsal @lkollar

The issue:

Fix inverted flamegraph width — Currently shows narrow chart when leaves sum to small percentage, wasting screen space

The inverted view used thread presence as a proxy for self time.
This missed self samples on C-level wrapper frames like _run_code,
where the node's thread always appears in its children too. Those
samples were silently dropped, causing the chart to render narrower
than full width. Now uses the explicit self field on each node
instead of the thread heuristic.
@pablogsal pablogsal merged commit 993e204 into python:main Apr 28, 2026
56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.