-
Notifications
You must be signed in to change notification settings - Fork 792
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
[Merged by Bors] - Pre-allocate vectors in SSZ decoding #3417
[Merged by Bors] - Pre-allocate vectors in SSZ decoding #3417
Conversation
Running this for 24h on two similar Ropsten nodes didn't yield any significant change. If anything the vanilla v2.5.1 (light blue) code seems to be using slightly less free memory than this PR (dark blue) I'm on the fence about whether we should bother merging it. On one hand explicit is better than implicit, so maybe we should be explicit about the allocation behaviour we want here rather than relying on the optimiser or the allocator to smooth it out for us (i.e. merge). On the other hand, if it ain't broke maybe we shouldn't meddle with it unnecessarily. |
bors r+ |
## Issue Addressed Fixes a potential regression in memory fragmentation identified by @paulhauner here: #3371 (comment). ## Proposed Changes Immediately allocate a vector with sufficient size to hold all decoded elements in SSZ decoding. The `size_hint` is derived from the range iterator here: https://github.com/sigp/lighthouse/blob/2983235650811437b44199f9c94e517e948a1e9b/consensus/ssz/src/decode/impls.rs#L489 ## Additional Info I'd like to test this out on some infra for a substantial duration to see if it affects total fragmentation.
Build failed (retrying...): |
## Issue Addressed Fixes a potential regression in memory fragmentation identified by @paulhauner here: #3371 (comment). ## Proposed Changes Immediately allocate a vector with sufficient size to hold all decoded elements in SSZ decoding. The `size_hint` is derived from the range iterator here: https://github.com/sigp/lighthouse/blob/2983235650811437b44199f9c94e517e948a1e9b/consensus/ssz/src/decode/impls.rs#L489 ## Additional Info I'd like to test this out on some infra for a substantial duration to see if it affects total fragmentation.
This PR was included in a batch that was canceled, it will be automatically retried |
bors r- |
Canceled. |
bors r+ |
bors r- |
Canceled. |
bors r+ |
## Issue Addressed Fixes a potential regression in memory fragmentation identified by @paulhauner here: #3371 (comment). ## Proposed Changes Immediately allocate a vector with sufficient size to hold all decoded elements in SSZ decoding. The `size_hint` is derived from the range iterator here: https://github.com/sigp/lighthouse/blob/2983235650811437b44199f9c94e517e948a1e9b/consensus/ssz/src/decode/impls.rs#L489 ## Additional Info I'd like to test this out on some infra for a substantial duration to see if it affects total fragmentation.
Build failed (retrying...): |
## Issue Addressed Fixes a potential regression in memory fragmentation identified by @paulhauner here: #3371 (comment). ## Proposed Changes Immediately allocate a vector with sufficient size to hold all decoded elements in SSZ decoding. The `size_hint` is derived from the range iterator here: https://github.com/sigp/lighthouse/blob/2983235650811437b44199f9c94e517e948a1e9b/consensus/ssz/src/decode/impls.rs#L489 ## Additional Info I'd like to test this out on some infra for a substantial duration to see if it affects total fragmentation.
Build failed (retrying...): |
## Issue Addressed Fixes a potential regression in memory fragmentation identified by @paulhauner here: #3371 (comment). ## Proposed Changes Immediately allocate a vector with sufficient size to hold all decoded elements in SSZ decoding. The `size_hint` is derived from the range iterator here: https://github.com/sigp/lighthouse/blob/2983235650811437b44199f9c94e517e948a1e9b/consensus/ssz/src/decode/impls.rs#L489 ## Additional Info I'd like to test this out on some infra for a substantial duration to see if it affects total fragmentation.
## Issue Addressed Fixes a potential regression in memory fragmentation identified by @paulhauner here: sigp#3371 (comment). ## Proposed Changes Immediately allocate a vector with sufficient size to hold all decoded elements in SSZ decoding. The `size_hint` is derived from the range iterator here: https://github.com/sigp/lighthouse/blob/2983235650811437b44199f9c94e517e948a1e9b/consensus/ssz/src/decode/impls.rs#L489 ## Additional Info I'd like to test this out on some infra for a substantial duration to see if it affects total fragmentation.
Issue Addressed
Fixes a potential regression in memory fragmentation identified by @paulhauner here: #3371 (comment).
Proposed Changes
Immediately allocate a vector with sufficient size to hold all decoded elements in SSZ decoding. The
size_hint
is derived from the range iterator here:lighthouse/consensus/ssz/src/decode/impls.rs
Line 489 in 2983235
Additional Info
I'd like to test this out on some infra for a substantial duration to see if it affects total fragmentation.