perf(trie): fix allocation hot paths with capacity hints and buffer reuse (#21466)

Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: yongkangc <chiayongkang@hotmail.com>
This commit is contained in:
Georgios Konstantopoulos
2026-02-01 22:58:45 -08:00
committed by GitHub
parent 9382a4c713
commit e7d4a05e36

View File

@@ -105,10 +105,10 @@ impl<TC, HC, VE: LeafValueEncoder> ProofCalculator<TC, HC, VE> {
hashed_cursor,
branch_stack: Vec::<_>::with_capacity(64),
branch_path: Nibbles::new(),
child_stack: Vec::<_>::new(),
child_stack: Vec::<_>::with_capacity(64),
cached_branch_stack: Vec::<_>::with_capacity(64),
retained_proofs: Vec::<_>::new(),
rlp_nodes_bufs: Vec::<_>::new(),
retained_proofs: Vec::<_>::with_capacity(32),
rlp_nodes_bufs: Vec::<_>::with_capacity(8),
rlp_encode_buf: Vec::<_>::with_capacity(RLP_ENCODE_BUF_SIZE),
}
}