Skip to content

Differential flamegraphs duplicate self time across line nodes #154085

Description

@pablogsal

Bug report

Bug description:

Differential flamegraphs group paths without line numbers, but attach the combined values to every rendered line node. This duplicates the self time.

import time

def f():
    time.sleep(0.5)
    time.sleep(0.5)

f()
python -m profiling.sampling run --binary -o baseline.bin demo.py
python -m profiling.sampling run --diff-flamegraph baseline.bin -o diff.html demo.py

Both f line nodes get the full combined self time. Their annotated self time is twice the actual self time, even though the profiles are identical.

CPython versions tested on:

3.16

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytopic-profilingtype-bugAn unexpected behavior, bug, or error

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions