mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: improve Nibbles-related code (#5631)
This commit is contained in:
@ -3,17 +3,12 @@ use reth_primitives::trie::Nibbles;
|
||||
|
||||
/// Benchmarks the nibble unpacking.
|
||||
pub fn nibbles_benchmark(c: &mut Criterion) {
|
||||
c.bench_function("Nibbles unpack", |b| {
|
||||
let mut g = c.benchmark_group("nibbles");
|
||||
g.bench_function("unpack", |b| {
|
||||
let raw = (1..=32).collect::<Vec<u8>>();
|
||||
b.iter(|| {
|
||||
Nibbles::unpack(&raw);
|
||||
})
|
||||
b.iter(|| Nibbles::unpack(&raw))
|
||||
});
|
||||
}
|
||||
|
||||
criterion_group! {
|
||||
name = benches;
|
||||
config = Criterion::default();
|
||||
targets = nibbles_benchmark
|
||||
}
|
||||
criterion_group!(benches, nibbles_benchmark);
|
||||
criterion_main!(benches);
|
||||
|
||||
Reference in New Issue
Block a user