-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[cp 1.10] Memory improvements/limits for DelayedFields (#12580, #12583, #12581) #12594
[cp 1.10] Memory improvements/limits for DelayedFields (#12580, #12583, #12581) #12594
Conversation
This reduces memory footprint of amortized usage of delayed field with a single version from 3000 bytes to 600 bytes per delayed field. Basically BTreeMap stores things in vectors of 5, and size of the value is large. This invalidates BTreeMap's cache optimization of storing them all together.
temporarily, until gas charges for aggregator loading are implemented, limit number of aggregators per resource
63ac82d
to
907a74f
Compare
@@ -246,6 +246,17 @@ impl DelayedFieldValue { | |||
}, | |||
}) | |||
} | |||
|
|||
/// Approximate memory consumption of current DelayedFieldValue | |||
pub fn get_approximate_memory_size(&self) -> usize { |
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 "approximate"?
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.
because I am not sure about the exact footprint of the vector, and actual size doesn't matter, as there is a lot of uncertainty in the maps that store these as well.
@@ -211,6 +213,22 @@ pub static BLOCK_COMMITTED_TXNS: Lazy<HistogramVec> = Lazy::new(|| { | |||
.unwrap() | |||
}); | |||
|
|||
pub static BLOCK_VIEW_DISTINCT_KEYS: Lazy<HistogramVec> = Lazy::new(|| { | |||
register_avg_counter_vec( | |||
"aptos_execution_block_view_distinct_keys", |
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.
What "keys" does this refer to? Comments would be helpful.
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.
keys in the view, every map (resource/resource_group/modules/delayed_fields has different key), and each is broken down separately
I am going to leave documentation improvements to follow-up PR on main, as this is a cherry-pick to release branch, not the original PR
|
||
pub static BLOCK_VIEW_BASE_VALUES_MEMORY_USAGE: Lazy<HistogramVec> = Lazy::new(|| { | ||
register_avg_counter_vec( | ||
"aptos_execution_block_view_base_values_memory_usage", |
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.
What does "base values" mean here? Comments would be helpful.
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.
base value / storage version, basically not the versions from writes, but from storage
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## aptos-release-v1.10 #12594 +/- ##
======================================================
Coverage ? 71.7%
======================================================
Files ? 811
Lines ? 185848
Branches ? 0
======================================================
Hits ? 133364
Misses ? 52484
Partials ? 0 ☔ View full report in Codecov by Sentry. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
✅ Forge suite
|
Combined three memory related changes into this cherry-pick : #12580, #12583, #12581