-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pkg/storage: Remove storing cumulative values #337
Conversation
cumulative: []*ProfileTreeValueNode{{ | ||
Value: int64(21), | ||
}}, | ||
//cumulative: []*ProfileTreeValueNode{{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why comment, not remove?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went through all of these comments and removed them. Seems like I missed a few.
Thanks!
@@ -57,7 +58,7 @@ func TestMemRootSeries_Iterator(t *testing.T) { | |||
itt := p.ProfileTree().Iterator() | |||
for itt.HasMore() { | |||
if itt.NextChild() { | |||
require.Equal(t, seen, itt.At().CumulativeValues()[0].Value) | |||
//require.Equal(t, seen, itt.At().CumulativeValues()[0].Value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love that we can show here that pre-computing the values actually made things slower. Architecturally looks good, and our regression tests should have caught any inconsistencies in results, so I feel confident that this works as expected!
I don't feel too strongly about the commented-out parts being removed in this or a follow-up PR. Your call.
Awesome. Yeah, it's probably to go with this now and do the cleanup in a follow-up. :) |
Instead of storing cumulative values, we are going to only store the flat values (these are the values that the leaves have), and then when generating the flame graph we'll calculate the cumulative values on the fly.
This will mostly show in heap usage over time:
Benchmarks for appending got faster and more lightweight as well as querying (although we calculate all cumulative values).
Appends:
Iterator: