Open itamarst opened 1 year ago
That's... bizarre. Looking at the code some more, I think this isn't the rendering but the actual diff collapse computation. Specifically, I wonder if it's related to this comment: https://github.com/jonhoo/inferno/blob/a497e3eab4d1586b2802b1807ba00cbac802dbc7/src/flamegraph/merge.rs#L92-L94
FWIW the current implementation matches the output of FlameGraph, and from what I can tell it's the intended behavior. See the part boxed in red below from differential-flame-graphs.
I'm torn here because the current output is also pretty hard to inuit the meaning of. Maybe the trick here is going to be mainly around how we present the information in the hover popup on frames that have children. I feel like with some labels for which thing got how much slower, it might actually help a lot. I take Brendan's point that this choice is probably the one that gives more useful data, even if it is not the most intuitive one.
I am not sure I agree with the argument, it's useful to see which general areas had differences. On the other hand I'm wondering if differences in general are even useful for my case, since I'm including line numbers and that means minor changes to code can make a whole file non-comparable. So I'm not going to push on this thread until I get back to thinking about that...
Consider a diff of these two (
cargo run --bin inferno-diff-folded old1.prof new2.prof | cargo run --bin inferno-flamegraph -- - > out.svg
):and
The resulting flamegraph shows
parent
as unchanged, even though it's actually gotten larger: