lighthouse/consensus/ssz/src
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
..
decode Pre-allocate vectors in SSZ decoding (#3417) 2022-09-16 11:54:17 +00:00
encode Remove equivocating validators from fork choice (#3371) 2022-07-28 09:43:41 +00:00
decode.rs Remove equivocating validators from fork choice (#3371) 2022-07-28 09:43:41 +00:00
encode.rs 1.57.0 lints (#2850) 2021-12-03 04:44:30 +00:00
legacy.rs Implement SSZ union type (#2579) 2021-09-25 05:58:36 +00:00
lib.rs Remove equivocating validators from fork choice (#3371) 2022-07-28 09:43:41 +00:00
union_selector.rs Implement SSZ union type (#2579) 2021-09-25 05:58:36 +00:00