lighthouse/consensus/ssz
Michael Sproul 5b2843c2cd Pre-allocate vectors in SSZ decoding (#3417)
## Issue Addressed

Fixes a potential regression in memory fragmentation identified by @paulhauner here: https://github.com/sigp/lighthouse/pull/3371#discussion_r931770045.

## 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:

2983235650/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.
2022-09-16 11:54:17 +00:00
..
examples Directory Restructure (#1163) 2020-05-18 21:24:23 +10:00
src Pre-allocate vectors in SSZ decoding (#3417) 2022-09-16 11:54:17 +00:00
tests Remove equivocating validators from fork choice (#3371) 2022-07-28 09:43:41 +00:00
Cargo.toml Remove equivocating validators from fork choice (#3371) 2022-07-28 09:43:41 +00:00
README.md Directory Restructure (#1163) 2020-05-18 21:24:23 +10:00

simpleserialize (ssz)