parca icon indicating copy to clipboard operation
parca copied to clipboard

pkg/query: relative comparisons

Open metalmatze opened this issue 10 months ago • 2 comments

When comparing profiles, people usually want to compare relatively, meaning they care about the relative percentages that changed between the profiles, not about the exact times a stack has been seen. This change ensures that we scale both profiles to the same total cumulative value for the root and then multiply each diff value by the ratio between both roots.

metalmatze avatar May 02 '24 14:05 metalmatze

🤖 Meticulous spotted visual differences in 37 of 498 screens tested: view and approve differences detected.

Last updated for commit 3f4cb5c. This comment will update as new commits are pushed.

alwaysmeticulous[bot] avatar May 06 '24 18:05 alwaysmeticulous[bot]

Now, we need to figure out the UX and UI to enable or disable the relative comparison. Most likely, a toggle that will show when comparing makes the most sense.

metalmatze avatar May 07 '24 09:05 metalmatze

Absolute

This shows the absolute comparison between the two profiles. It is what we have had all along. It'll be the default for all non-delta profiles (goroutine, memory). absolute

Relative

This shows the relative comparison of the two profiles. The smaller (in terms of overall cumulative value) profile gets scaled up (all of its values are multiplied by the factor the bigger profile is bigger) to have both profiles' total cumulative values be the same. Therefore, compare the percentage between all functions of both profiles.

relative

metalmatze avatar Jul 04 '24 14:07 metalmatze