sigp / lighthouse

Ethereum consensus client in Rust
https://lighthouse.sigmaprime.io/
Apache License 2.0
2.95k stars 757 forks source link

Try storing `Arc<Validator>` in `HDiffBuffer` #6579

Open michaelsproul opened 2 weeks ago

michaelsproul commented 2 weeks ago

Description

The HDiffBuffer now contains a Vec<Validator> which we could optimise by using Arc:

The validator entries come from a milhouse List originally where they are arced, so we could clone these arcs and share memory between any live milhouse lists and hdiff buffers with the same data. For the freezer DB this isn't particularly likely to happen, but once we start implementing hdiffs in the hot DB, it will be quite common.