|
pub fn size_bytes(&self) -> ByteSize { |
|
// TODO: Cache this |
|
ByteSize::b(block_as_ssz_data(self).ssz_bytes_len() as u64) |
|
} |
Propose a caching implementation for ConsensusBlock size by:
- Introducing a new
ConsensusBlock field cached_size_bytes of type OnceLock from std
- Lazily initialize this field on demand in
size_bytes
- Update references to ConsensusBlock in codebase
arc-node/crates/types/src/block.rs
Lines 55 to 58 in cf51a19
Propose a caching implementation for ConsensusBlock size by:
ConsensusBlockfield cached_size_bytes of typeOnceLockfrom stdsize_bytes