chore: rm flaky bench (#20413)

This commit is contained in:
Matthias Seitz
2025-12-16 10:35:38 +01:00
committed by GitHub
parent 08a16a5bde
commit bbd51862d4

View File

@@ -76,12 +76,6 @@ pub fn prefix_set_lookups(c: &mut Criterion) {
test_data.clone(),
size,
);
prefix_set_bench::<VecBinarySearchPrefixSet>(
&mut group,
"`Vec` with binary search lookup",
test_data.clone(),
size,
);
}
}
@@ -207,43 +201,6 @@ mod implementations {
false
}
}
#[derive(Default)]
pub struct VecBinarySearchPrefixSet {
keys: Vec<Nibbles>,
sorted: bool,
}
impl PrefixSetMutAbstraction for VecBinarySearchPrefixSet {
type Frozen = Self;
fn insert(&mut self, key: Nibbles) {
self.sorted = false;
self.keys.push(key);
}
fn freeze(self) -> Self::Frozen {
self
}
}
impl PrefixSetAbstraction for VecBinarySearchPrefixSet {
fn contains(&mut self, prefix: Nibbles) -> bool {
if !self.sorted {
self.keys.sort();
self.sorted = true;
}
match self.keys.binary_search(&prefix) {
Ok(_) => true,
Err(idx) => match self.keys.get(idx) {
Some(key) => key.starts_with(&prefix),
None => false, // prefix > last key
},
}
}
}
#[derive(Default)]
pub struct VecCursorPrefixSet {
keys: Vec<Nibbles>,