perf: trie micro optimizations (#13282)

This commit is contained in:
DaniPopes
2024-12-11 05:52:42 +01:00
committed by GitHub
parent 0144a433df
commit 0494ca01d5
37 changed files with 306 additions and 246 deletions

View File

@ -1,6 +1,6 @@
#![allow(missing_docs, unreachable_pub)]
use alloy_primitives::{map::HashMap, B256, U256};
use alloy_primitives::{map::B256HashMap, B256, U256};
use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion};
use itertools::Itertools;
use proptest::{prelude::*, strategy::ValueTree, test_runner::TestRunner};
@ -193,7 +193,7 @@ pub fn calculate_root_from_leaves_repeated(c: &mut Criterion) {
}
}
fn generate_test_data(size: usize) -> HashMap<B256, U256> {
fn generate_test_data(size: usize) -> B256HashMap<U256> {
let mut runner = TestRunner::new(ProptestConfig::default());
proptest::collection::hash_map(any::<B256>(), any::<U256>(), size)
.new_tree(&mut runner)