From 0134ca7fc577970b306d51f80bb4bb6581c28b80 Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Tue, 15 Jul 2025 11:24:38 +0200 Subject: [PATCH 01/32] use Rc --- src/btreemap/iter.rs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/btreemap/iter.rs b/src/btreemap/iter.rs index 75483152..4bfc96f6 100644 --- a/src/btreemap/iter.rs +++ b/src/btreemap/iter.rs @@ -5,11 +5,12 @@ use super::{ use crate::{types::NULL, Address, Memory, Storable}; use std::borrow::Cow; use std::ops::{Bound, RangeBounds}; +use std::rc::Rc; /// An indicator of the current position in the map. pub(crate) enum Cursor { Address(Address), - Node { node: Box>, next: Index }, + Node { node: Rc>, next: Index }, } /// An index into a node's child or entry. @@ -100,7 +101,7 @@ where // We found the key exactly matching the left bound. // Here is where we'll start the iteration. self.forward_cursors.push(Cursor::Node { - node: Box::new(node), + node: Rc::new(node), next: Index::Entry(idx), }); break; @@ -118,7 +119,7 @@ where && self.range.contains(node.key(idx + 1, self.map.memory())) { self.forward_cursors.push(Cursor::Node { - node: Box::new(node), + node: Rc::new(node), next: Index::Entry(idx + 1), }); } @@ -156,7 +157,7 @@ where && self.range.contains(node.key(idx, self.map.memory())) { self.forward_cursors.push(Cursor::Node { - node: Box::new(node), + node: Rc::new(node), next: Index::Entry(idx), }); } @@ -196,7 +197,7 @@ where // We found the key exactly matching the right bound. // Here is where we'll start the iteration. self.backward_cursors.push(Cursor::Node { - node: Box::new(node), + node: Rc::new(node), next: Index::Entry(idx), }); break; @@ -214,7 +215,7 @@ where && self.range.contains(node.key(idx - 1, self.map.memory())) { self.backward_cursors.push(Cursor::Node { - node: Box::new(node), + node: Rc::new(node), next: Index::Entry(idx - 1), }); } @@ -250,7 +251,7 @@ where if idx > 0 && self.range.contains(node.key(idx - 1, self.map.memory())) { self.backward_cursors.push(Cursor::Node { - node: Box::new(node), + node: Rc::new(node), next: Index::Entry(idx - 1), }); } @@ -293,7 +294,7 @@ where // Iterate on leaf nodes starting from the first entry. NodeType::Leaf => Index::Entry(0), }, - node: Box::new(node), + node: Rc::new(node), }); } self.next_map(map) @@ -379,7 +380,7 @@ where } { self.backward_cursors.push(Cursor::Node { next, - node: Box::new(node), + node: Rc::new(node), }); } } From 29590f6dd5311e00d5f0b192c10dc2b2c9e978dd Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Tue, 15 Jul 2025 15:57:55 +0200 Subject: [PATCH 02/32] add lazy entry --- benchmarks/btreemap/src/main.rs | 5 +- benchmarks/nns/src/nns_vote_cascading.rs | 12 ++- src/btreemap.rs | 85 ++++++++++++------- src/btreemap/iter.rs | 103 +++++++++++++++-------- src/btreemap/proptests.rs | 59 ++++++++++--- src/btreeset.rs | 2 +- tests/api_conformance.rs | 15 +++- 7 files changed, 192 insertions(+), 89 deletions(-) diff --git a/benchmarks/btreemap/src/main.rs b/benchmarks/btreemap/src/main.rs index be0f648d..9b7e9413 100644 --- a/benchmarks/btreemap/src/main.rs +++ b/benchmarks/btreemap/src/main.rs @@ -777,6 +777,7 @@ fn range_key_sum_helper_v2(count: usize, size: usize) -> BenchResult { bench_fn(|| { btree .range((Bound::Included(0), Bound::Included(size as u32))) + .map(|entry| (entry.key().clone(), entry.value())) .map(|(k, _)| k) .sum::() }) @@ -794,8 +795,8 @@ fn range_value_sum_helper_v2(count: usize, size: usize) -> BenchResult { bench_fn(|| { btree .range((Bound::Included(0), Bound::Included(size as u32))) - .filter(|(k, _)| k % 3 == 0) - .map(|(_, v)| v.len()) + .filter(|entry| *entry.key() % 3 == 0) + .map(|entry| entry.value().len()) .sum::() }) } diff --git a/benchmarks/nns/src/nns_vote_cascading.rs b/benchmarks/nns/src/nns_vote_cascading.rs index 6dadf5b5..514c5196 100644 --- a/benchmarks/nns/src/nns_vote_cascading.rs +++ b/benchmarks/nns/src/nns_vote_cascading.rs @@ -69,12 +69,12 @@ impl NeuronStore for StableNeuronStore { let previous_followees = self .followees_map .range(min_followee_map_key..=max_followee_map_key) - .map(|(_key, value)| value) + .map(|entry| entry.value()) .collect::>(); let previous_followee_keys = self .followees_map .range(min_followee_map_key..=max_followee_map_key) - .map(|(key, _value)| key) + .map(|entry| *entry.key()) .collect::>(); for key in previous_followee_keys { self.followees_map.remove(&key); @@ -104,7 +104,7 @@ impl NeuronStore for StableNeuronStore { self.followees_map .range(min_key..=max_key) - .map(|(_key, followee_neuron_id)| followee_neuron_id) + .map(|entry| entry.value()) .collect() } @@ -114,7 +114,11 @@ impl NeuronStore for StableNeuronStore { self.followers_index .range(min_key..=max_key) - .map(|(((_topic, _followee_neuron_id), follower_neuron_id), _value)| follower_neuron_id) + //.map(|(((_topic, _followee_neuron_id), follower_neuron_id), _value)| follower_neuron_id) + .map(|entry| { + let ((_, follower_neuron_id), _) = entry.key(); + *follower_neuron_id + }) .collect() } } diff --git a/src/btreemap.rs b/src/btreemap.rs index 022f1171..3cc4674f 100644 --- a/src/btreemap.rs +++ b/src/btreemap.rs @@ -1195,7 +1195,8 @@ where /// /// Returns an empty iterator if no smaller key exists. pub fn iter_from_prev_key(&self, bound: &K) -> Iter<'_, K, V, M> { - if let Some((start_key, _)) = self.range(..bound).next_back() { + if let Some(entry) = self.range(..bound).next_back() { + let start_key = entry.key().clone(); IterInternal::new_in_range(self, (Bound::Included(start_key), Bound::Unbounded)).into() } else { IterInternal::null(self).into() @@ -1350,6 +1351,7 @@ where mod test { use super::*; use crate::{ + btreemap::iter::LazyEntry, storable::{Blob, Bound as StorableBound}, VectorMemory, }; @@ -1366,7 +1368,17 @@ mod test { /// A helper function to collect owned key/value pairs into a `Vec`. fn collect(it: impl Iterator) -> Vec<(K, V)> { - it.collect() + it.map(|(k, v)| (k, v)).collect() + } + + fn collect_e<'a, K, V, M>(it: impl Iterator>) -> Vec<(K, V)> + where + K: Storable + Ord + Clone + 'a, + V: Storable + 'a, + M: Memory + 'a, + { + it.map(|entry| (entry.key().clone(), entry.value())) + .collect() } /// Returns a fixed‑size buffer for the given u32. @@ -2428,9 +2440,9 @@ mod test { let key = K::build; run_btree_test(|btree: BTreeMap| { // Test prefixes that don't exist in the map. - assert_eq!(collect(btree.range(key(0)..)), vec![]); - assert_eq!(collect(btree.range(key(10)..)), vec![]); - assert_eq!(collect(btree.range(key(100)..)), vec![]); + assert_eq!(collect_e(btree.range(key(0)..)), vec![]); + assert_eq!(collect_e(btree.range(key(10)..)), vec![]); + assert_eq!(collect_e(btree.range(key(100)..)), vec![]); }); } btree_test!(test_range_empty, range_empty); @@ -2442,7 +2454,7 @@ mod test { btree.insert(key(0), value(0)); // Test a prefix that's larger than the value in the leaf node. Should be empty. - assert_eq!(collect(btree.range(key(1)..)), vec![]); + assert_eq!(collect_e(btree.range(key(1)..)), vec![]); }); } btree_test!( @@ -2465,7 +2477,7 @@ mod test { // Test a prefix that's larger than the key in the internal node. assert_eq!( - collect(btree.range(key(7)..key(8))), + collect_e(btree.range(key(7)..key(8))), vec![(key(7), value(7))] ); }); @@ -2506,7 +2518,7 @@ mod test { // Tests a prefix that's smaller than the key in the internal node. assert_eq!( - collect(btree.range(key(0)..key(11))), + collect_e(btree.range(key(0)..key(11))), vec![ (key(1), value(100)), (key(2), value(200)), @@ -2517,7 +2529,7 @@ mod test { // Tests a prefix that crosses several nodes. assert_eq!( - collect(btree.range(key(10)..key(20))), + collect_e(btree.range(key(10)..key(20))), vec![ (key(11), value(500)), (key(12), value(600)), @@ -2528,7 +2540,7 @@ mod test { // Tests a prefix that's larger than the key in the internal node. assert_eq!( - collect(btree.range(key(20)..key(30))), + collect_e(btree.range(key(20)..key(30))), vec![ (key(21), value(900)), (key(22), value(1_000)), @@ -2618,11 +2630,11 @@ mod test { ); // Tests a prefix that doesn't exist, but is in the middle of the root node. - assert_eq!(collect(btree.range(key(15)..key(16))), vec![]); + assert_eq!(collect_e(btree.range(key(15)..key(16))), vec![]); // Tests a prefix beginning in the middle of the tree and crossing several nodes. assert_eq!( - collect(btree.range(key(15)..=key(26))), + collect_e(btree.range(key(15)..=key(26))), vec![ (key(16), value(700)), (key(18), value(800)), @@ -2638,7 +2650,7 @@ mod test { // Tests a prefix that crosses several nodes. assert_eq!( - collect(btree.range(key(10)..key(20))), + collect_e(btree.range(key(10)..key(20))), vec![ (key(12), value(500)), (key(14), value(600)), @@ -2651,7 +2663,7 @@ mod test { // Tests a prefix that starts from a leaf node, then iterates through the root and right // sibling. assert_eq!( - collect(btree.range(key(20)..key(30))), + collect_e(btree.range(key(20)..key(30))), vec![ (key(21), value(1000)), (key(22), value(1100)), @@ -2681,19 +2693,19 @@ mod test { // Check range [0, MID): should yield exactly the first MID entries. let keys: Vec<_> = btree.range(key(0)..key(MID)).collect(); assert_eq!(keys.len(), MID as usize); - for (i, (k, v)) in keys.into_iter().enumerate() { + for (i, entry) in keys.into_iter().enumerate() { let j = i as u32; - assert_eq!(k, key(j)); - assert_eq!(v, value(j)); + assert_eq!(*entry.key(), key(j)); + assert_eq!(entry.value(), value(j)); } // Check range [MID, TOTAL): should yield the remaining entries. let keys: Vec<_> = btree.range(key(MID)..).collect(); assert_eq!(keys.len(), (TOTAL - MID) as usize); - for (i, (k, v)) in keys.into_iter().enumerate() { + for (i, entry) in keys.into_iter().enumerate() { let j = MID + i as u32; - assert_eq!(k, key(j)); - assert_eq!(v, value(j)); + assert_eq!(*entry.key(), key(j)); + assert_eq!(entry.value(), value(j)); } }); } @@ -2729,7 +2741,7 @@ mod test { assert_eq!(root.children_len(), 2); assert_eq!( - collect(btree.range(key(0)..key(10))), + collect_e(btree.range(key(0)..key(10))), vec![ (key(1), value(100)), (key(2), value(200)), @@ -2740,12 +2752,12 @@ mod test { // Tests an offset that has a keys somewhere in the range of keys of an internal node. assert_eq!( - collect(btree.range(key(13)..key(20))), + collect_e(btree.range(key(13)..key(20))), vec![(key(13), value(700)), (key(14), value(800))] ); // Tests an offset that's larger than the key in the internal node. - assert_eq!(collect(btree.range(key(25)..)), vec![]); + assert_eq!(collect_e(btree.range(key(25)..)), vec![]); }); } btree_test!( @@ -2830,7 +2842,7 @@ mod test { // Tests a offset that crosses several nodes. assert_eq!( - collect(btree.range(key(14)..key(20))), + collect_e(btree.range(key(14)..key(20))), vec![ (key(14), value(0)), (key(16), value(0)), @@ -2842,7 +2854,7 @@ mod test { // Tests a offset that starts from a leaf node, then iterates through the root and right // sibling. assert_eq!( - collect(btree.range(key(22)..key(30))), + collect_e(btree.range(key(22)..key(30))), vec![ (key(22), value(0)), (key(23), value(0)), @@ -2937,22 +2949,25 @@ mod test { stable_map.insert(key(i), value(i)); } - assert_eq!(collect_kv(std_map.range(..)), collect(stable_map.range(..))); + assert_eq!( + collect_kv(std_map.range(..)), + collect_e(stable_map.range(..)) + ); for l in 0..=NKEYS { assert_eq!( collect_kv(std_map.range(key(l)..)), - collect(stable_map.range(key(l)..)) + collect_e(stable_map.range(key(l)..)) ); assert_eq!( collect_kv(std_map.range(..key(l))), - collect(stable_map.range(..key(l))) + collect_e(stable_map.range(..key(l))) ); assert_eq!( collect_kv(std_map.range(..=key(l))), - collect(stable_map.range(..=key(l))) + collect_e(stable_map.range(..=key(l))) ); for r in l + 1..=NKEYS { @@ -2961,7 +2976,7 @@ mod test { let range = (lbound.clone(), rbound); assert_eq!( collect_kv(std_map.range(range.clone())), - collect(stable_map.range(range.clone())), + collect_e(stable_map.range(range.clone())), "range: {range:?}" ); } @@ -2979,14 +2994,20 @@ mod test { btree.insert(key(j), value(j)); for i in 0..=j { assert_eq!( - btree.iter_from_prev_key(&key(i + 1)).next(), + btree + .iter_from_prev_key(&key(i + 1)) + .next() + .map(|entry| (entry.key().clone(), entry.value())), Some((key(i), value(i))), "failed to get an upper bound for key({})", i + 1 ); } assert_eq!( - btree.iter_from_prev_key(&key(0)).next(), + btree + .iter_from_prev_key(&key(0)) + .next() + .map(|entry| (entry.key().clone(), entry.value())), None, "key(0) must not have an upper bound" ); diff --git a/src/btreemap/iter.rs b/src/btreemap/iter.rs index 4bfc96f6..01affeeb 100644 --- a/src/btreemap/iter.rs +++ b/src/btreemap/iter.rs @@ -276,7 +276,7 @@ where // Iterates to find the next element in the requested range. // If it exists, `map` is applied to that element and the result is returned. - fn next_map, usize) -> T>(&mut self, map: F) -> Option { + fn next_map>, usize) -> T>(&mut self, map: F) -> Option { if !self.forward_cursors_initialized { self.initialize_forward_cursors(); } @@ -356,7 +356,7 @@ where // Iterates to find the next back element in the requested range. // If it exists, `map` is applied to that element and the result is returned. - fn next_back_map, usize) -> T>(&mut self, map: F) -> Option { + fn next_back_map>, usize) -> T>(&mut self, map: F) -> Option { if !self.backward_cursors_initialized { self.initialize_backward_cursors(); } @@ -447,24 +447,52 @@ where } } +pub struct LazyEntry<'a, K, V, M> +where + K: Storable + Ord + Clone, + V: Storable, + M: Memory, +{ + node: Rc>, + entry_idx: usize, + map: &'a BTreeMap, +} + +impl LazyEntry<'_, K, V, M> +where + K: Storable + Ord + Clone, + V: Storable, + M: Memory, +{ + pub fn key(&self) -> &K { + self.node.key(self.entry_idx, self.map.memory()) + } + + pub fn value(&self) -> V { + let encoded_value = self.node.value(self.entry_idx, self.map.memory()); + V::from_bytes(Cow::Borrowed(encoded_value)) + } +} + pub struct Iter<'a, K, V, M>(IterInternal<'a, K, V, M>) where K: Storable + Ord + Clone, V: Storable, M: Memory; -impl Iterator for Iter<'_, K, V, M> +impl<'a, K, V, M> Iterator for Iter<'a, K, V, M> where K: Storable + Ord + Clone, V: Storable, M: Memory, { - type Item = (K, V); + type Item = LazyEntry<'a, K, V, M>; fn next(&mut self) -> Option { - self.0.next_map(|node, entry_idx| { - let (key, encoded_value) = node.entry(entry_idx, self.0.map.memory()); - (key.clone(), V::from_bytes(Cow::Borrowed(encoded_value))) + self.0.next_map(|node, entry_idx| LazyEntry { + node: node.clone(), + entry_idx, + map: self.0.map, }) } @@ -483,9 +511,10 @@ where M: Memory, { fn next_back(&mut self) -> Option { - self.0.next_back_map(|node, entry_idx| { - let (key, encoded_value) = node.entry(entry_idx, self.0.map.memory()); - (key.clone(), V::from_bytes(Cow::Borrowed(encoded_value))) + self.0.next_back_map(|node, entry_idx| LazyEntry { + node: node.clone(), + entry_idx, + map: self.0.map, }) } } @@ -625,9 +654,9 @@ mod test { } let mut i = 0; - for (key, value) in btree.iter() { - assert_eq!(key, i); - assert_eq!(value, i + 1); + for entry in btree.iter() { + assert_eq!(*entry.key(), i); + assert_eq!(entry.value(), i + 1); i += 1; } @@ -646,9 +675,9 @@ mod test { // Iteration should be in ascending order. let mut i = 0; - for (key, value) in btree.iter() { - assert_eq!(key, i); - assert_eq!(value, i + 1); + for entry in btree.iter() { + assert_eq!(*entry.key(), i); + assert_eq!(entry.value(), i + 1); i += 1; } @@ -667,9 +696,9 @@ mod test { // Iteration should be in ascending order. let mut i = 10; - for (key, value) in btree.range(10..90) { - assert_eq!(key, i); - assert_eq!(value, i + 1); + for entry in btree.range(10..90) { + assert_eq!(*entry.key(), i); + assert_eq!(entry.value(), i + 1); i += 1; } @@ -688,10 +717,10 @@ mod test { // Iteration should be in descending order. let mut i = 100; - for (key, value) in btree.iter().rev() { + for entry in btree.iter().rev() { i -= 1; - assert_eq!(key, i); - assert_eq!(value, i + 1); + assert_eq!(*entry.key(), i); + assert_eq!(entry.value(), i + 1); } assert_eq!(i, 0); @@ -709,10 +738,10 @@ mod test { // Iteration should be in descending order. let mut i = 80; - for (key, value) in btree.range(20..80).rev() { + for entry in btree.range(20..80).rev() { i -= 1; - assert_eq!(key, i); - assert_eq!(value, i + 1); + assert_eq!(*entry.key(), i); + assert_eq!(entry.value(), i + 1); } assert_eq!(i, 20); @@ -731,13 +760,13 @@ mod test { let mut iter = btree.iter(); for i in 0..50 { - let (key, value) = iter.next().unwrap(); - assert_eq!(key, i); - assert_eq!(value, i + 1); + let entry = iter.next().unwrap(); + assert_eq!(*entry.key(), i); + assert_eq!(entry.value(), i + 1); - let (key, value) = iter.next_back().unwrap(); - assert_eq!(key, 99 - i); - assert_eq!(value, 100 - i); + let entry = iter.next_back().unwrap(); + assert_eq!(*entry.key(), 99 - i); + assert_eq!(entry.value(), 100 - i); } assert!(iter.next().is_none()); @@ -757,13 +786,13 @@ mod test { let mut iter = btree.range(30..70); for i in 0..20 { - let (key, value) = iter.next().unwrap(); - assert_eq!(key, 30 + i); - assert_eq!(value, 31 + i); + let entry = iter.next().unwrap(); + assert_eq!(*entry.key(), 30 + i); + assert_eq!(entry.value(), 31 + i); - let (key, value) = iter.next_back().unwrap(); - assert_eq!(key, 69 - i); - assert_eq!(value, 70 - i); + let entry = iter.next_back().unwrap(); + assert_eq!(*entry.key(), 69 - i); + assert_eq!(entry.value(), 70 - i); } assert!(iter.next().is_none()); diff --git a/src/btreemap/proptests.rs b/src/btreemap/proptests.rs index 16c7cc99..b1f68509 100644 --- a/src/btreemap/proptests.rs +++ b/src/btreemap/proptests.rs @@ -146,7 +146,12 @@ fn map_iter_from_prev_key(#[strategy(pvec(0u64..u64::MAX -1 , 10..100))] keys: V for k in keys.iter() { map.insert(*k, ()); - prop_assert_eq!(Some((*k, ())), map.iter_from_prev_key(&(k + 1)).next()); + prop_assert_eq!( + Some((*k, ())), + map.iter_from_prev_key(&(k + 1)) + .next() + .map(|entry| (*entry.key(), entry.value())) + ); } Ok(()) @@ -215,7 +220,10 @@ fn execute_operation( let std_iter = std_btree.iter().skip(from).take(len); let mut stable_iter = btree.iter().skip(from).take(len); for (k1, v1) in std_iter { - let (k2, v2) = stable_iter.next().unwrap(); + let (k2, v2) = stable_iter + .next() + .map(|entry| (entry.key().clone(), entry.value())) + .unwrap(); assert_eq!(k1, &k2); assert_eq!(v1, &v2); } @@ -234,7 +242,10 @@ fn execute_operation( let std_iter = std_btree.iter().rev().skip(from).take(len); let mut stable_iter = btree.iter().rev().skip(from).take(len); for (k1, v1) in std_iter { - let (k2, v2) = stable_iter.next().unwrap(); + let (k2, v2) = stable_iter + .next() + .map(|entry| (entry.key().clone(), entry.value())) + .unwrap(); assert_eq!(k1, &k2); assert_eq!(v1, &v2); } @@ -283,7 +294,13 @@ fn execute_operation( } let idx = idx % std_btree.len(); - if let Some((k, v)) = btree.iter().skip(idx).take(1).next() { + if let Some((k, v)) = btree + .iter() + .skip(idx) + .take(1) + .next() + .map(|entry| (entry.key().clone(), entry.value())) + { eprintln!("Get({})", hex::encode(&k)); assert_eq!(std_btree.get(&k), Some(&v)); assert_eq!(btree.get(&k), Some(v)); @@ -297,7 +314,13 @@ fn execute_operation( let idx = idx % std_btree.len(); - if let Some((k, v)) = btree.iter().skip(idx).take(1).next() { + if let Some((k, v)) = btree + .iter() + .skip(idx) + .take(1) + .next() + .map(|entry| (entry.key().clone(), entry.value())) + { eprintln!("Remove({})", hex::encode(&k)); assert_eq!(std_btree.remove(&k), Some(v.clone())); assert_eq!(btree.remove(&k), Some(v)); @@ -314,8 +337,24 @@ fn execute_operation( let end = std::cmp::min(std_btree.len() - 1, from + len); // Create a range for the stable btree from the keys at indexes `from` and `end`. - let range_start = btree.iter().skip(from).take(1).next().unwrap().0.clone(); - let range_end = btree.iter().skip(end).take(1).next().unwrap().0.clone(); + let range_start = btree + .iter() + .skip(from) + .take(1) + .next() + .map(|entry| (entry.key().clone(), entry.value())) + .unwrap() + .0 + .clone(); + let range_end = btree + .iter() + .skip(end) + .take(1) + .next() + .map(|entry| (entry.key().clone(), entry.value())) + .unwrap() + .0 + .clone(); let stable_range = btree.range(range_start..range_end); // Create a range for the std btree from the keys at indexes `from` and `end`. @@ -330,9 +369,9 @@ fn execute_operation( let range_end = std_btree.iter().skip(end).take(1).next().unwrap().0.clone(); let std_range = std_btree.range(range_start..range_end); - for ((k1, v1), (k2, v2)) in std_range.zip(stable_range) { - assert_eq!(k1, &k2); - assert_eq!(v1, &v2); + for ((k1, v1), entry2) in std_range.zip(stable_range) { + assert_eq!(k1, entry2.key()); + assert_eq!(*v1, entry2.value()); } } Operation::PopLast => { diff --git a/src/btreeset.rs b/src/btreeset.rs index 8257eec1..d111cd7d 100644 --- a/src/btreeset.rs +++ b/src/btreeset.rs @@ -35,7 +35,7 @@ where type Item = K; fn next(&mut self) -> Option { - self.iter_internal.next().map(|(a, _)| a) + self.iter_internal.next().map(|entry| entry.key().clone()) // TODO: maybe iterate over keys only? } } diff --git a/tests/api_conformance.rs b/tests/api_conformance.rs index cbe9dd58..3f81394c 100644 --- a/tests/api_conformance.rs +++ b/tests/api_conformance.rs @@ -57,7 +57,10 @@ fn api_conformance_btreemap() { // Iterators. // Note: stable.iter() yields (K, V), std.iter() yields (&K, &V) - let stable_items: std::vec::Vec<_> = stable.iter().collect(); + let stable_items: std::vec::Vec<_> = stable + .iter() + .map(|entry| (*entry.key(), entry.value())) + .collect(); let std_items: std::vec::Vec<_> = std.iter().map(|(k, v)| (*k, v.clone())).collect(); assert_eq!(stable_items, std_items); @@ -93,7 +96,10 @@ fn api_conformance_btreemap() { let range_start = 3; let range_end = 7; - let stable_range: std::vec::Vec<_> = stable.range(range_start..range_end).collect(); + let stable_range: std::vec::Vec<_> = stable + .range(range_start..range_end) + .map(|entry| (*entry.key(), entry.value())) + .collect(); let std_range: std::vec::Vec<_> = std .range(range_start..range_end) .map(|(k, v)| (*k, v.clone())) @@ -123,7 +129,10 @@ fn api_conformance_btreemap() { // To simulate in std: use .range(..bound).next_back() to get the largest < bound, // then iterate from that key forward using .range(start..). let bound = 5; - let stable_result: std::vec::Vec<_> = stable.iter_from_prev_key(&bound).collect(); + let stable_result: std::vec::Vec<_> = stable + .iter_from_prev_key(&bound) + .map(|entry| (*entry.key(), entry.value())) + .collect(); let std_result: std::vec::Vec<_> = if let Some((start, _)) = std.range(..bound).next_back() { std.range(start..).map(|(k, v)| (*k, v.clone())).collect() } else { From e129cc59a357462815795aa316f63d685a1c7e5b Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Tue, 15 Jul 2025 16:04:15 +0200 Subject: [PATCH 03/32] . --- src/btreemap.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/btreemap.rs b/src/btreemap.rs index 3cc4674f..e8cf02aa 100644 --- a/src/btreemap.rs +++ b/src/btreemap.rs @@ -1368,7 +1368,7 @@ mod test { /// A helper function to collect owned key/value pairs into a `Vec`. fn collect(it: impl Iterator) -> Vec<(K, V)> { - it.map(|(k, v)| (k, v)).collect() + it.collect() } fn collect_e<'a, K, V, M>(it: impl Iterator>) -> Vec<(K, V)> From 6af96e796a41299b04c9e6d87a7321bf0fe5dc64 Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Tue, 15 Jul 2025 16:10:35 +0200 Subject: [PATCH 04/32] fix doc test --- benchmarks/btreemap/canbench_results.yml | 598 +++++++++++------------ src/btreemap.rs | 8 +- 2 files changed, 303 insertions(+), 303 deletions(-) diff --git a/benchmarks/btreemap/canbench_results.yml b/benchmarks/btreemap/canbench_results.yml index 4d164584..8ec6ffc6 100644 --- a/benchmarks/btreemap/canbench_results.yml +++ b/benchmarks/btreemap/canbench_results.yml @@ -2,903 +2,903 @@ benches: btreemap_v2_contains_10mib_values: total: calls: 1 - instructions: 142210325 + instructions: 146994443 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_blob8_u64: total: calls: 1 - instructions: 277134712 + instructions: 277297908 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_blob_1024_128: total: calls: 1 - instructions: 4278312217 + instructions: 4278409559 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_blob_128_128: total: calls: 1 - instructions: 819285681 + instructions: 819382999 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_blob_16_128: total: calls: 1 - instructions: 293742975 + instructions: 293840411 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_blob_256_128: total: calls: 1 - instructions: 1310685287 + instructions: 1310782619 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_blob_32_0: total: calls: 1 - instructions: 329571719 + instructions: 329670151 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_blob_32_1024: total: calls: 1 - instructions: 326072097 + instructions: 326169465 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_blob_32_128: total: calls: 1 - instructions: 326242314 + instructions: 326339716 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_blob_32_16: total: calls: 1 - instructions: 318823973 + instructions: 318921323 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_blob_32_256: total: calls: 1 - instructions: 324026367 + instructions: 324123767 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_blob_32_32: total: calls: 1 - instructions: 330971981 + instructions: 331069337 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_blob_32_4: total: calls: 1 - instructions: 323046095 + instructions: 323143453 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_blob_32_512: total: calls: 1 - instructions: 321643229 + instructions: 321740587 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_blob_32_64: total: calls: 1 - instructions: 324885334 + instructions: 324982674 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_blob_32_8: total: calls: 1 - instructions: 324308878 + instructions: 324406268 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_blob_4_128: total: calls: 1 - instructions: 243884967 + instructions: 243961485 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_blob_512_128: total: calls: 1 - instructions: 2281494289 + instructions: 2281591609 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_blob_64_128: total: calls: 1 - instructions: 403270584 + instructions: 403367950 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_blob_8_128: total: calls: 1 - instructions: 268086207 + instructions: 268183463 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_principal: total: calls: 1 - instructions: 349062610 + instructions: 349175694 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_u64_blob8: total: calls: 1 - instructions: 219629119 + instructions: 219726441 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_u64_u64: total: calls: 1 - instructions: 223284326 + instructions: 223420764 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_u64_vec8: total: calls: 1 - instructions: 219629119 + instructions: 219726441 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_vec8_u64: total: calls: 1 - instructions: 374095890 + instructions: 374193078 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_vec_1024_128: total: calls: 1 - instructions: 1817385622 + instructions: 1819014928 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_vec_128_128: total: calls: 1 - instructions: 568150650 + instructions: 568693397 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_vec_16_128: total: calls: 1 - instructions: 442851826 + instructions: 443198270 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_vec_256_128: total: calls: 1 - instructions: 896432175 + instructions: 897089684 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_vec_32_0: total: calls: 1 - instructions: 355321635 + instructions: 355419003 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_vec_32_1024: total: calls: 1 - instructions: 520527229 + instructions: 522016102 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_vec_32_128: total: calls: 1 - instructions: 428325937 + instructions: 428737249 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_vec_32_16: total: calls: 1 - instructions: 367802150 + instructions: 367899502 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_vec_32_256: total: calls: 1 - instructions: 433045196 + instructions: 433632922 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_vec_32_32: total: calls: 1 - instructions: 355276471 + instructions: 355373825 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_vec_32_4: total: calls: 1 - instructions: 352561298 + instructions: 352658656 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_vec_32_512: total: calls: 1 - instructions: 454924839 + instructions: 455714924 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_vec_32_64: total: calls: 1 - instructions: 398356880 + instructions: 398551250 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_vec_32_8: total: calls: 1 - instructions: 352626675 + instructions: 352724065 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_vec_4_128: total: calls: 1 - instructions: 404252150 + instructions: 404615996 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_vec_512_128: total: calls: 1 - instructions: 1246829046 + instructions: 1247777789 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_vec_64_128: total: calls: 1 - instructions: 493185629 + instructions: 493694675 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_vec_8_128: total: calls: 1 - instructions: 396603085 + instructions: 396899411 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_10mib_values: total: calls: 1 - instructions: 388592804 + instructions: 393376922 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_blob8_u64: total: calls: 1 - instructions: 299599641 + instructions: 299762837 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_blob_1024_128: total: calls: 1 - instructions: 4457685507 + instructions: 4457782849 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_blob_128_128: total: calls: 1 - instructions: 855273807 + instructions: 855371125 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_blob_16_128: total: calls: 1 - instructions: 308463753 + instructions: 308561189 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_blob_256_128: total: calls: 1 - instructions: 1367052477 + instructions: 1367149809 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_blob_32_0: total: calls: 1 - instructions: 337429950 + instructions: 337528382 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_blob_32_1024: total: calls: 1 - instructions: 350508333 + instructions: 350605701 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_blob_32_128: total: calls: 1 - instructions: 341653262 + instructions: 341750664 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_blob_32_16: total: calls: 1 - instructions: 330651190 + instructions: 330748540 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_blob_32_256: total: calls: 1 - instructions: 342643724 + instructions: 342741124 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_blob_32_32: total: calls: 1 - instructions: 342697250 + instructions: 342794606 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_blob_32_4: total: calls: 1 - instructions: 334169026 + instructions: 334266384 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_blob_32_512: total: calls: 1 - instructions: 342695399 + instructions: 342792757 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_blob_32_64: total: calls: 1 - instructions: 336813935 + instructions: 336911275 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_blob_32_8: total: calls: 1 - instructions: 335925065 + instructions: 336022455 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_blob_4_128: total: calls: 1 - instructions: 254906111 + instructions: 254982629 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_blob_512_128: total: calls: 1 - instructions: 2378828514 + instructions: 2378925834 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_blob_64_128: total: calls: 1 - instructions: 428744853 + instructions: 428842219 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_blob_8_128: total: calls: 1 - instructions: 279716343 + instructions: 279813599 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_principal: total: calls: 1 - instructions: 356428202 + instructions: 356541286 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_u64_blob8: total: calls: 1 - instructions: 226446414 + instructions: 226543736 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_u64_u64: total: calls: 1 - instructions: 230534752 + instructions: 230671190 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_u64_vec8: total: calls: 1 - instructions: 226935610 + instructions: 227032932 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_vec8_u64: total: calls: 1 - instructions: 379651663 + instructions: 379748851 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_vec_1024_128: total: calls: 1 - instructions: 1870806515 + instructions: 1872435821 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_vec_128_128: total: calls: 1 - instructions: 577227038 + instructions: 577769785 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_vec_16_128: total: calls: 1 - instructions: 449737724 + instructions: 450084168 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_vec_256_128: total: calls: 1 - instructions: 905669607 + instructions: 906327116 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_vec_32_0: total: calls: 1 - instructions: 358216658 + instructions: 358314026 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_vec_32_1024: total: calls: 1 - instructions: 544469486 + instructions: 545958359 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_vec_32_128: total: calls: 1 - instructions: 436037967 + instructions: 436449279 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_vec_32_16: total: calls: 1 - instructions: 373713570 + instructions: 373810922 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_vec_32_256: total: calls: 1 - instructions: 447151619 + instructions: 447739345 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_vec_32_32: total: calls: 1 - instructions: 361330699 + instructions: 361428053 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_vec_32_4: total: calls: 1 - instructions: 358348309 + instructions: 358445667 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_vec_32_512: total: calls: 1 - instructions: 472992093 + instructions: 473782178 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_vec_32_64: total: calls: 1 - instructions: 404811886 + instructions: 405006256 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_vec_32_8: total: calls: 1 - instructions: 358456622 + instructions: 358554012 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_vec_4_128: total: calls: 1 - instructions: 411151875 + instructions: 411515721 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_vec_512_128: total: calls: 1 - instructions: 1256149861 + instructions: 1257098604 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_vec_64_128: total: calls: 1 - instructions: 501687251 + instructions: 502196297 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_vec_8_128: total: calls: 1 - instructions: 403496154 + instructions: 403792480 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_insert_10mib_values: total: calls: 1 - instructions: 4387226354 + instructions: 4393895240 heap_increase: 161 stable_memory_increase: 3613 scopes: {} btreemap_v2_insert_blob8_u64: total: calls: 1 - instructions: 436629416 + instructions: 437964614 heap_increase: 0 stable_memory_increase: 4 scopes: {} btreemap_v2_insert_blob_1024_128: total: calls: 1 - instructions: 5496218165 + instructions: 5497586809 heap_increase: 0 stable_memory_increase: 196 scopes: {} btreemap_v2_insert_blob_128_128: total: calls: 1 - instructions: 1180834208 + instructions: 1182202900 heap_increase: 0 stable_memory_increase: 46 scopes: {} btreemap_v2_insert_blob_16_128: total: calls: 1 - instructions: 486246194 + instructions: 487577318 heap_increase: 0 stable_memory_increase: 24 scopes: {} btreemap_v2_insert_blob_256_128: total: calls: 1 - instructions: 1789034049 + instructions: 1790404779 heap_increase: 0 stable_memory_increase: 67 scopes: {} btreemap_v2_insert_blob_32_0: total: calls: 1 - instructions: 490455134 + instructions: 491805123 heap_increase: 0 stable_memory_increase: 8 scopes: {} btreemap_v2_insert_blob_32_1024: total: calls: 1 - instructions: 703496225 + instructions: 704849715 heap_increase: 0 stable_memory_increase: 173 scopes: {} btreemap_v2_insert_blob_32_128: total: calls: 1 - instructions: 542564351 + instructions: 543913855 heap_increase: 0 stable_memory_increase: 28 scopes: {} btreemap_v2_insert_blob_32_16: total: calls: 1 - instructions: 519113244 + instructions: 520474321 heap_increase: 0 stable_memory_increase: 11 scopes: {} btreemap_v2_insert_blob_32_256: total: calls: 1 - instructions: 570686267 + instructions: 572041599 heap_increase: 0 stable_memory_increase: 49 scopes: {} btreemap_v2_insert_blob_32_32: total: calls: 1 - instructions: 528947313 + instructions: 530304259 heap_increase: 0 stable_memory_increase: 13 scopes: {} btreemap_v2_insert_blob_32_4: total: calls: 1 - instructions: 509376109 + instructions: 510730548 heap_increase: 0 stable_memory_increase: 8 scopes: {} btreemap_v2_insert_blob_32_512: total: calls: 1 - instructions: 610059178 + instructions: 611412954 heap_increase: 0 stable_memory_increase: 91 scopes: {} btreemap_v2_insert_blob_32_64: total: calls: 1 - instructions: 534917409 + instructions: 536272645 heap_increase: 0 stable_memory_increase: 18 scopes: {} btreemap_v2_insert_blob_32_8: total: calls: 1 - instructions: 517590057 + instructions: 518938257 heap_increase: 0 stable_memory_increase: 9 scopes: {} btreemap_v2_insert_blob_4_128: total: calls: 1 - instructions: 407266843 + instructions: 408464336 heap_increase: 0 stable_memory_increase: 13 scopes: {} btreemap_v2_insert_blob_512_128: total: calls: 1 - instructions: 3041219347 + instructions: 3042590891 heap_increase: 0 stable_memory_increase: 111 scopes: {} btreemap_v2_insert_blob_64_128: total: calls: 1 - instructions: 661175552 + instructions: 662540780 heap_increase: 0 stable_memory_increase: 34 scopes: {} btreemap_v2_insert_blob_8_128: total: calls: 1 - instructions: 458612442 + instructions: 459911504 heap_increase: 0 stable_memory_increase: 20 scopes: {} btreemap_v2_insert_principal: total: calls: 1 - instructions: 503303086 + instructions: 504676710 heap_increase: 0 stable_memory_increase: 8 scopes: {} btreemap_v2_insert_u64_blob8: total: calls: 1 - instructions: 406739905 + instructions: 407793709 heap_increase: 0 stable_memory_increase: 5 scopes: {} btreemap_v2_insert_u64_u64: total: calls: 1 - instructions: 414575469 + instructions: 415652170 heap_increase: 0 stable_memory_increase: 6 scopes: {} btreemap_v2_insert_u64_vec8: total: calls: 1 - instructions: 410368222 + instructions: 411420090 heap_increase: 0 stable_memory_increase: 21 scopes: {} btreemap_v2_insert_vec8_u64: total: calls: 1 - instructions: 594100537 + instructions: 595396789 heap_increase: 0 stable_memory_increase: 16 scopes: {} btreemap_v2_insert_vec_1024_128: total: calls: 1 - instructions: 2744513878 + instructions: 2746997363 heap_increase: 0 stable_memory_increase: 193 scopes: {} btreemap_v2_insert_vec_128_128: total: calls: 1 - instructions: 1012625574 + instructions: 1014206877 heap_increase: 0 stable_memory_increase: 51 scopes: {} btreemap_v2_insert_vec_16_128: total: calls: 1 - instructions: 708984362 + instructions: 710493786 heap_increase: 0 stable_memory_increase: 31 scopes: {} btreemap_v2_insert_vec_256_128: total: calls: 1 - instructions: 1402182234 + instructions: 1403786622 heap_increase: 0 stable_memory_increase: 71 scopes: {} btreemap_v2_insert_vec_32_0: total: calls: 1 - instructions: 621845953 + instructions: 623195765 heap_increase: 0 stable_memory_increase: 20 scopes: {} btreemap_v2_insert_vec_32_1024: total: calls: 1 - instructions: 1182054323 + instructions: 1184610264 heap_increase: 0 stable_memory_increase: 171 scopes: {} btreemap_v2_insert_vec_32_128: total: calls: 1 - instructions: 756092289 + instructions: 757646787 heap_increase: 0 stable_memory_increase: 33 scopes: {} btreemap_v2_insert_vec_32_16: total: calls: 1 - instructions: 666188006 + instructions: 667548104 heap_increase: 0 stable_memory_increase: 20 scopes: {} btreemap_v2_insert_vec_32_256: total: calls: 1 - instructions: 869200138 + instructions: 870894717 heap_increase: 0 stable_memory_increase: 54 scopes: {} btreemap_v2_insert_vec_32_32: total: calls: 1 - instructions: 661641515 + instructions: 662998461 heap_increase: 0 stable_memory_increase: 20 scopes: {} btreemap_v2_insert_vec_32_4: total: calls: 1 - instructions: 660350181 + instructions: 661704365 heap_increase: 0 stable_memory_increase: 20 scopes: {} btreemap_v2_insert_vec_32_512: total: calls: 1 - instructions: 973623252 + instructions: 975520187 heap_increase: 0 stable_memory_increase: 91 scopes: {} btreemap_v2_insert_vec_32_64: total: calls: 1 - instructions: 691630844 + instructions: 693064409 heap_increase: 0 stable_memory_increase: 24 scopes: {} btreemap_v2_insert_vec_32_8: total: calls: 1 - instructions: 659842170 + instructions: 661190300 heap_increase: 0 stable_memory_increase: 20 scopes: {} btreemap_v2_insert_vec_4_128: total: calls: 1 - instructions: 604348722 + instructions: 605724847 heap_increase: 0 stable_memory_increase: 16 scopes: {} btreemap_v2_insert_vec_512_128: total: calls: 1 - instructions: 1859108239 + instructions: 1860966136 heap_increase: 0 stable_memory_increase: 112 scopes: {} btreemap_v2_insert_vec_64_128: total: calls: 1 - instructions: 846297779 + instructions: 847931143 heap_increase: 0 stable_memory_increase: 41 scopes: {} btreemap_v2_insert_vec_8_128: total: calls: 1 - instructions: 666278550 + instructions: 667744222 heap_increase: 0 stable_memory_increase: 23 scopes: {} @@ -919,21 +919,21 @@ benches: btreemap_v2_mem_manager_contains_u64_u64: total: calls: 1 - instructions: 283522171 + instructions: 283547624 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_contains_u64_vec512: total: calls: 1 - instructions: 367041614 + instructions: 367207972 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_contains_vec512_u64: total: calls: 1 - instructions: 1201243952 + instructions: 1202831521 heap_increase: 0 stable_memory_increase: 0 scopes: {} @@ -954,1169 +954,1169 @@ benches: btreemap_v2_mem_manager_get_u64_u64: total: calls: 1 - instructions: 291718588 + instructions: 291744284 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_get_u64_vec512: total: calls: 1 - instructions: 388831325 + instructions: 389034775 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_get_vec512_u64: total: calls: 1 - instructions: 1242312078 + instructions: 1243929644 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_insert_blob512_u64: total: calls: 1 - instructions: 3127693876 + instructions: 3127471976 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_insert_u64_blob512: total: calls: 1 - instructions: 607302030 + instructions: 607078432 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_insert_u64_u64: total: calls: 1 - instructions: 520562305 + instructions: 520351629 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_insert_u64_vec512: total: calls: 1 - instructions: 834230066 + instructions: 834231288 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_insert_vec512_u64: total: calls: 1 - instructions: 1964533302 + instructions: 1966051747 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_remove_blob512_u64: total: calls: 1 - instructions: 4310230683 + instructions: 4309901195 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_remove_u64_blob512: total: calls: 1 - instructions: 882979670 + instructions: 882652080 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_remove_u64_u64: total: calls: 1 - instructions: 736797990 + instructions: 736514798 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_remove_u64_vec512: total: calls: 1 - instructions: 1223992077 + instructions: 1223922287 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_remove_vec512_u64: total: calls: 1 - instructions: 3084753399 + instructions: 3086440829 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob8_u64: total: calls: 1 - instructions: 599252070 + instructions: 600984469 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_1024_128: total: calls: 1 - instructions: 8387598840 + instructions: 8389699808 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_128_128: total: calls: 1 - instructions: 1824721939 + instructions: 1826791637 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_16_128: total: calls: 1 - instructions: 743080488 + instructions: 744953359 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_256_128: total: calls: 1 - instructions: 2763907811 + instructions: 2766001871 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_32_0: total: calls: 1 - instructions: 751493486 + instructions: 753499341 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_32_1024: total: calls: 1 - instructions: 1121477481 + instructions: 1123483257 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_32_128: total: calls: 1 - instructions: 860281370 + instructions: 862303750 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_32_16: total: calls: 1 - instructions: 795091803 + instructions: 797081885 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_32_256: total: calls: 1 - instructions: 891735934 + instructions: 893745590 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_32_32: total: calls: 1 - instructions: 808556626 + instructions: 810546584 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_32_4: total: calls: 1 - instructions: 778860667 + instructions: 780860323 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_32_512: total: calls: 1 - instructions: 957567308 + instructions: 959564386 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_32_64: total: calls: 1 - instructions: 817402668 + instructions: 819393436 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_32_8: total: calls: 1 - instructions: 796775177 + instructions: 798800344 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_4_128: total: calls: 1 - instructions: 371433628 + instructions: 372504352 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_512_128: total: calls: 1 - instructions: 4613696303 + instructions: 4615784181 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_64_128: total: calls: 1 - instructions: 1031691323 + instructions: 1033746155 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_8_128: total: calls: 1 - instructions: 604973040 + instructions: 606579846 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_principal: total: calls: 1 - instructions: 800186729 + instructions: 802260561 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_u64_blob8: total: calls: 1 - instructions: 669272017 + instructions: 670935050 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_u64_u64: total: calls: 1 - instructions: 681259383 + instructions: 682969871 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_u64_vec8: total: calls: 1 - instructions: 671825185 + instructions: 673450744 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec8_u64: total: calls: 1 - instructions: 782873009 + instructions: 784507353 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_1024_128: total: calls: 1 - instructions: 4049152840 + instructions: 4053201799 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_128_128: total: calls: 1 - instructions: 1503200945 + instructions: 1505757042 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_16_128: total: calls: 1 - instructions: 1024759071 + instructions: 1026906349 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_256_128: total: calls: 1 - instructions: 2019833997 + instructions: 2022457349 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_32_0: total: calls: 1 - instructions: 862942768 + instructions: 864943154 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_32_1024: total: calls: 1 - instructions: 1689732148 + instructions: 1693750095 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_32_128: total: calls: 1 - instructions: 1088853861 + instructions: 1091338398 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_32_16: total: calls: 1 - instructions: 928266909 + instructions: 930257229 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_32_256: total: calls: 1 - instructions: 1215441024 + instructions: 1218069203 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_32_32: total: calls: 1 - instructions: 931024329 + instructions: 933013579 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_32_4: total: calls: 1 - instructions: 914741844 + instructions: 916739142 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_32_512: total: calls: 1 - instructions: 1373208474 + instructions: 1376183677 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_32_64: total: calls: 1 - instructions: 972723364 + instructions: 974870391 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_32_8: total: calls: 1 - instructions: 924963880 + instructions: 926988022 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_4_128: total: calls: 1 - instructions: 540977502 + instructions: 542189616 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_512_128: total: calls: 1 - instructions: 2716276969 + instructions: 2719276737 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_64_128: total: calls: 1 - instructions: 1234517190 + instructions: 1237055704 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_8_128: total: calls: 1 - instructions: 850723549 + instructions: 852559775 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob8_u64: total: calls: 1 - instructions: 575657399 + instructions: 577386453 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_1024_128: total: calls: 1 - instructions: 8055243789 + instructions: 8057349727 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_128_128: total: calls: 1 - instructions: 1755505092 + instructions: 1757576966 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_16_128: total: calls: 1 - instructions: 716552465 + instructions: 718424421 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_256_128: total: calls: 1 - instructions: 2669726290 + instructions: 2671818382 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_32_0: total: calls: 1 - instructions: 723331257 + instructions: 725344017 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_32_1024: total: calls: 1 - instructions: 1085446885 + instructions: 1087450383 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_32_128: total: calls: 1 - instructions: 825898514 + instructions: 827921914 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_32_16: total: calls: 1 - instructions: 766897485 + instructions: 768885285 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_32_256: total: calls: 1 - instructions: 860875781 + instructions: 862884553 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_32_32: total: calls: 1 - instructions: 775932537 + instructions: 777918755 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_32_4: total: calls: 1 - instructions: 755120630 + instructions: 757127700 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_32_512: total: calls: 1 - instructions: 932316858 + instructions: 934313226 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_32_64: total: calls: 1 - instructions: 791541850 + instructions: 793533814 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_32_8: total: calls: 1 - instructions: 768157909 + instructions: 770184951 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_4_128: total: calls: 1 - instructions: 357882924 + instructions: 358951666 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_512_128: total: calls: 1 - instructions: 4444563339 + instructions: 4446650571 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_64_128: total: calls: 1 - instructions: 999734778 + instructions: 1001786772 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_8_128: total: calls: 1 - instructions: 598939732 + instructions: 600548987 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_principal: total: calls: 1 - instructions: 780286737 + instructions: 782358691 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_u64_blob8: total: calls: 1 - instructions: 645807686 + instructions: 647470766 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_u64_u64: total: calls: 1 - instructions: 657450509 + instructions: 659159226 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_u64_vec8: total: calls: 1 - instructions: 648264001 + instructions: 649889002 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec8_u64: total: calls: 1 - instructions: 759543968 + instructions: 761178344 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_1024_128: total: calls: 1 - instructions: 4254705881 + instructions: 4258755882 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_128_128: total: calls: 1 - instructions: 1509632411 + instructions: 1512184524 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_16_128: total: calls: 1 - instructions: 1006112737 + instructions: 1008272591 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_256_128: total: calls: 1 - instructions: 2073306796 + instructions: 2075921754 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_32_0: total: calls: 1 - instructions: 846105831 + instructions: 848111599 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_32_1024: total: calls: 1 - instructions: 1664340419 + instructions: 1668346209 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_32_128: total: calls: 1 - instructions: 1064595433 + instructions: 1067076377 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_32_16: total: calls: 1 - instructions: 902970558 + instructions: 904958510 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_32_256: total: calls: 1 - instructions: 1193426296 + instructions: 1196045296 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_32_32: total: calls: 1 - instructions: 910486468 + instructions: 912472018 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_32_4: total: calls: 1 - instructions: 898981741 + instructions: 900986325 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_32_512: total: calls: 1 - instructions: 1356854198 + instructions: 1359834458 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_32_64: total: calls: 1 - instructions: 949770518 + instructions: 951915781 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_32_8: total: calls: 1 - instructions: 902469709 + instructions: 904495679 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_4_128: total: calls: 1 - instructions: 527057733 + instructions: 528265894 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_512_128: total: calls: 1 - instructions: 2808111599 + instructions: 2811118797 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_64_128: total: calls: 1 - instructions: 1220784792 + instructions: 1223314103 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_8_128: total: calls: 1 - instructions: 850608896 + instructions: 852451588 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_range_count_1k_0b: total: calls: 1 - instructions: 16905 + instructions: 16947 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_range_count_1k_10kib: total: calls: 1 - instructions: 2475828 + instructions: 2548132 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_range_count_20_10mib: total: calls: 1 - instructions: 18469125 + instructions: 19090139 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_range_key_sum_1k_0b: total: calls: 1 - instructions: 17147 + instructions: 17399 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_range_key_sum_1k_10kib: total: calls: 1 - instructions: 56755378 + instructions: 56907005 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_range_key_sum_20_10mib: total: calls: 1 - instructions: 1103713932 + instructions: 1104336722 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_range_value_sum_1k_0b: total: calls: 1 - instructions: 17161 + instructions: 17289 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_range_value_sum_1k_10kib: total: calls: 1 - instructions: 56767374 + instructions: 20708891 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_range_value_sum_20_10mib: total: calls: 1 - instructions: 1103714168 + instructions: 398926591 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_10mib_values: total: calls: 1 - instructions: 4709565702 + instructions: 4715220476 heap_increase: 0 stable_memory_increase: 657 scopes: {} btreemap_v2_remove_blob8_u64: total: calls: 1 - instructions: 584632796 + instructions: 586740933 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_1024_128: total: calls: 1 - instructions: 7363796307 + instructions: 7366276007 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_128_128: total: calls: 1 - instructions: 1588752303 + instructions: 1591208353 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_16_128: total: calls: 1 - instructions: 665334293 + instructions: 667670809 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_256_128: total: calls: 1 - instructions: 2421693283 + instructions: 2424157337 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_32_0: total: calls: 1 - instructions: 654246003 + instructions: 656670864 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_32_1024: total: calls: 1 - instructions: 985322023 + instructions: 987710153 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_32_128: total: calls: 1 - instructions: 746605092 + instructions: 748986080 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_32_16: total: calls: 1 - instructions: 700056094 + instructions: 702426862 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_32_256: total: calls: 1 - instructions: 784121825 + instructions: 786500153 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_32_32: total: calls: 1 - instructions: 711915619 + instructions: 714296575 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_32_4: total: calls: 1 - instructions: 696210302 + instructions: 698620572 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_32_512: total: calls: 1 - instructions: 857932817 + instructions: 860348477 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_32_64: total: calls: 1 - instructions: 737070467 + instructions: 739516375 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_32_8: total: calls: 1 - instructions: 696054096 + instructions: 698420032 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_4_128: total: calls: 1 - instructions: 452855812 + instructions: 454283424 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_512_128: total: calls: 1 - instructions: 4071503214 + instructions: 4073984952 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_64_128: total: calls: 1 - instructions: 910048338 + instructions: 912421076 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_8_128: total: calls: 1 - instructions: 599296531 + instructions: 601391159 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_principal: total: calls: 1 - instructions: 684154256 + instructions: 686637993 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_u64_blob8: total: calls: 1 - instructions: 566075041 + instructions: 567961678 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_u64_u64: total: calls: 1 - instructions: 586713652 + instructions: 588636203 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_u64_vec8: total: calls: 1 - instructions: 571362323 + instructions: 573239240 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec8_u64: total: calls: 1 - instructions: 755820792 + instructions: 757940298 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_1024_128: total: calls: 1 - instructions: 4475823940 + instructions: 4479172212 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_128_128: total: calls: 1 - instructions: 1418195415 + instructions: 1420780368 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_16_128: total: calls: 1 - instructions: 921098213 + instructions: 923559881 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_256_128: total: calls: 1 - instructions: 2244605357 + instructions: 2247091590 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_32_0: total: calls: 1 - instructions: 834326197 + instructions: 836727519 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_32_1024: total: calls: 1 - instructions: 1701459670 + instructions: 1704981005 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_32_128: total: calls: 1 - instructions: 1036942087 + instructions: 1039536032 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_32_16: total: calls: 1 - instructions: 871324986 + instructions: 873694842 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_32_256: total: calls: 1 - instructions: 1240150803 + instructions: 1242839449 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_32_32: total: calls: 1 - instructions: 867565590 + instructions: 869946380 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_32_4: total: calls: 1 - instructions: 862143565 + instructions: 864553339 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_32_512: total: calls: 1 - instructions: 1405903551 + instructions: 1408773115 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_32_64: total: calls: 1 - instructions: 968300744 + instructions: 970794427 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_32_8: total: calls: 1 - instructions: 856473374 + instructions: 858857082 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_4_128: total: calls: 1 - instructions: 662114708 + instructions: 663721379 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_512_128: total: calls: 1 - instructions: 3082652829 + instructions: 3085357276 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_64_128: total: calls: 1 - instructions: 1183921648 + instructions: 1186524634 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_8_128: total: calls: 1 - instructions: 821763732 + instructions: 823969137 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_iter_1k_0b: total: calls: 1 - instructions: 1230497 + instructions: 983218 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_iter_1k_10kib: total: calls: 1 - instructions: 56742812 + instructions: 2532766 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_iter_20_10mib: total: calls: 1 - instructions: 1103712198 + instructions: 19088588 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_iter_rev_1k_0b: total: calls: 1 - instructions: 1230076 + instructions: 981392 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_iter_rev_1k_10kib: total: calls: 1 - instructions: 56713761 + instructions: 2512600 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_iter_rev_20_10mib: total: calls: 1 - instructions: 1103711703 + instructions: 19088500 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_keys_1k_0b: total: calls: 1 - instructions: 964793 + instructions: 981074 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_keys_1k_10kib: total: calls: 1 - instructions: 2477281 + instructions: 2530622 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_keys_20_10mib: total: calls: 1 - instructions: 18468280 + instructions: 19088554 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_keys_rev_1k_0b: total: calls: 1 - instructions: 964096 + instructions: 982640 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_keys_rev_1k_10kib: total: calls: 1 - instructions: 2474637 + instructions: 2513848 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_keys_rev_20_10mib: total: calls: 1 - instructions: 18468224 + instructions: 19088532 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_values_1k_0b: total: calls: 1 - instructions: 1207835 + instructions: 1236218 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_values_1k_10kib: total: calls: 1 - instructions: 56720150 + instructions: 56779282 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_values_20_10mib: total: calls: 1 - instructions: 1103711748 + instructions: 1104332266 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_values_rev_1k_0b: total: calls: 1 - instructions: 1208078 + instructions: 1232724 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_values_rev_1k_10kib: total: calls: 1 - instructions: 56691763 + instructions: 56718110 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_values_rev_20_10mib: total: calls: 1 - instructions: 1103711265 + instructions: 1104331697 heap_increase: 0 stable_memory_increase: 0 scopes: {} diff --git a/src/btreemap.rs b/src/btreemap.rs index e8cf02aa..a74b266b 100644 --- a/src/btreemap.rs +++ b/src/btreemap.rs @@ -1157,8 +1157,8 @@ where /// map.insert(1, "one".to_string()); /// map.insert(2, "two".to_string()); /// - /// for (key, value) in map.iter() { - /// println!("{}: {}", key, value); + /// for entry in map.iter() { + /// println!("{}: {}", entry.key(), entry.value()); /// } /// ``` pub fn iter(&self) -> Iter<'_, K, V, M> { @@ -1180,8 +1180,8 @@ where /// map.insert(3, "three".to_string()); /// /// // Get entries with keys between 1 and 3 (inclusive) - /// for (key, value) in map.range((Bound::Included(1), Bound::Included(3))) { - /// println!("{}: {}", key, value); + /// for entry in map.range((Bound::Included(1), Bound::Included(3))) { + /// println!("{}: {}", entry.key(), entry.value()); /// } /// ``` pub fn range(&self, key_range: impl RangeBounds) -> Iter<'_, K, V, M> { From 961230def2567a2dd77cb747416b2916b78d6241 Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Tue, 15 Jul 2025 16:13:37 +0200 Subject: [PATCH 05/32] --persist --- benchmarks/btreeset/canbench_results.yml | 160 +++++++++++------------ benchmarks/nns/canbench_results.yml | 24 ++-- 2 files changed, 92 insertions(+), 92 deletions(-) diff --git a/benchmarks/btreeset/canbench_results.yml b/benchmarks/btreeset/canbench_results.yml index de9d69f8..8c79367a 100644 --- a/benchmarks/btreeset/canbench_results.yml +++ b/benchmarks/btreeset/canbench_results.yml @@ -72,420 +72,420 @@ benches: btreeset_intersection_blob_1024: total: calls: 1 - instructions: 108263601 + instructions: 101680337 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_intersection_blob_128: total: calls: 1 - instructions: 17920913 + instructions: 16712295 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_intersection_blob_16: total: calls: 1 - instructions: 3384240 + instructions: 3049602 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_intersection_blob_256: total: calls: 1 - instructions: 30972687 + instructions: 28981189 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_intersection_blob_32: total: calls: 1 - instructions: 4649143 + instructions: 4315571 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_intersection_blob_512: total: calls: 1 - instructions: 56724310 + instructions: 53201464 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_intersection_blob_64: total: calls: 1 - instructions: 10030807 + instructions: 9211343 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_intersection_blob_8: total: calls: 1 - instructions: 3143262 + instructions: 2793050 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_intersection_u32: total: calls: 1 - instructions: 2255841 + instructions: 1921673 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_intersection_u64: total: calls: 1 - instructions: 2267883 + instructions: 1964949 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_is_disjoint_blob_1024: total: calls: 1 - instructions: 52366443 + instructions: 43769567 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_is_disjoint_blob_128: total: calls: 1 - instructions: 9323287 + instructions: 7897406 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_is_disjoint_blob_16: total: calls: 1 - instructions: 2175419 + instructions: 1907832 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_is_disjoint_blob_256: total: calls: 1 - instructions: 15614378 + instructions: 13164529 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_is_disjoint_blob_32: total: calls: 1 - instructions: 2838967 + instructions: 2539466 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_is_disjoint_blob_512: total: calls: 1 - instructions: 27865373 + instructions: 23366500 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_is_disjoint_blob_64: total: calls: 1 - instructions: 5294107 + instructions: 4381408 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_is_disjoint_blob_8: total: calls: 1 - instructions: 2092236 + instructions: 1850635 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_is_disjoint_u32: total: calls: 1 - instructions: 1538826 + instructions: 1316543 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_is_disjoint_u64: total: calls: 1 - instructions: 1556273 + instructions: 1343356 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_is_subset_blob_1024: total: calls: 1 - instructions: 384217 + instructions: 358419 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_is_subset_blob_128: total: calls: 1 - instructions: 89356 + instructions: 85062 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_is_subset_blob_16: total: calls: 1 - instructions: 53971 + instructions: 53155 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_is_subset_blob_256: total: calls: 1 - instructions: 131545 + instructions: 124179 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_is_subset_blob_32: total: calls: 1 - instructions: 45717 + instructions: 44795 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_is_subset_blob_512: total: calls: 1 - instructions: 215769 + instructions: 202259 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_is_subset_blob_64: total: calls: 1 - instructions: 57967 + instructions: 55209 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_is_subset_blob_8: total: calls: 1 - instructions: 52516 + instructions: 51777 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_is_subset_u32: total: calls: 1 - instructions: 43314 + instructions: 42450 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_is_subset_u64: total: calls: 1 - instructions: 43860 + instructions: 43256 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_is_superset_blob_1024: total: calls: 1 - instructions: 91649624 + instructions: 78740555 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_is_superset_blob_128: total: calls: 1 - instructions: 15493688 + instructions: 13352888 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_is_superset_blob_16: total: calls: 1 - instructions: 3305021 + instructions: 2920490 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_is_superset_blob_256: total: calls: 1 - instructions: 26708656 + instructions: 23003003 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_is_superset_blob_32: total: calls: 1 - instructions: 4519479 + instructions: 4069766 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_is_superset_blob_512: total: calls: 1 - instructions: 48351640 + instructions: 41561193 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_is_superset_blob_64: total: calls: 1 - instructions: 8632441 + instructions: 7266779 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_is_superset_blob_8: total: calls: 1 - instructions: 3083597 + instructions: 2727094 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_is_superset_u32: total: calls: 1 - instructions: 2253391 + instructions: 1921351 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_is_superset_u64: total: calls: 1 - instructions: 2268826 + instructions: 1961281 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_iter_blob_1024: total: calls: 1 - instructions: 433183747 + instructions: 430995530 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_iter_blob_128: total: calls: 1 - instructions: 75703425 + instructions: 74503150 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_iter_blob_16: total: calls: 1 - instructions: 15831272 + instructions: 14579696 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_iter_blob_256: total: calls: 1 - instructions: 127937637 + instructions: 125787984 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_iter_blob_32: total: calls: 1 - instructions: 22129524 + instructions: 20939791 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_iter_blob_512: total: calls: 1 - instructions: 229664008 + instructions: 227475530 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_iter_blob_64: total: calls: 1 - instructions: 40653995 + instructions: 39453577 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_iter_blob_8: total: calls: 1 - instructions: 15219849 + instructions: 14004824 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_iter_u32: total: calls: 1 - instructions: 11969602 + instructions: 10667867 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_iter_u64: total: calls: 1 - instructions: 12055874 + instructions: 10908079 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_range_blob_1024: total: calls: 1 - instructions: 260401564 + instructions: 259870196 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_range_blob_128: total: calls: 1 - instructions: 46191169 + instructions: 45508439 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_range_blob_16: total: calls: 1 - instructions: 10196231 + instructions: 9508605 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_range_blob_256: total: calls: 1 - instructions: 77000621 + instructions: 76456411 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_range_blob_32: total: calls: 1 - instructions: 13966929 + instructions: 13294157 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_range_blob_512: total: calls: 1 - instructions: 138120554 + instructions: 137589173 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_range_blob_64: total: calls: 1 - instructions: 25112906 + instructions: 24443488 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_range_blob_8: total: calls: 1 - instructions: 9824865 + instructions: 9144616 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_range_u32: total: calls: 1 - instructions: 7220114 + instructions: 6480292 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_range_u64: total: calls: 1 - instructions: 7262243 + instructions: 6624379 heap_increase: 0 stable_memory_increase: 0 scopes: {} @@ -562,140 +562,140 @@ benches: btreeset_symmetric_difference_blob_1024: total: calls: 1 - instructions: 108277727 + instructions: 101670997 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_symmetric_difference_blob_128: total: calls: 1 - instructions: 17924287 + instructions: 16692203 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_symmetric_difference_blob_16: total: calls: 1 - instructions: 3385864 + instructions: 3027274 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_symmetric_difference_blob_256: total: calls: 1 - instructions: 30977597 + instructions: 28962633 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_symmetric_difference_blob_32: total: calls: 1 - instructions: 4650811 + instructions: 4281313 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_symmetric_difference_blob_512: total: calls: 1 - instructions: 56732292 + instructions: 53185980 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_symmetric_difference_blob_64: total: calls: 1 - instructions: 10033413 + instructions: 9190483 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_symmetric_difference_blob_8: total: calls: 1 - instructions: 3144865 + instructions: 2776181 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_symmetric_difference_u32: total: calls: 1 - instructions: 2271949 + instructions: 1901309 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_symmetric_difference_u64: total: calls: 1 - instructions: 2273968 + instructions: 1935566 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_union_blob_1024: total: calls: 1 - instructions: 108278235 + instructions: 101691006 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_union_blob_128: total: calls: 1 - instructions: 17924795 + instructions: 16712212 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_union_blob_16: total: calls: 1 - instructions: 3386372 + instructions: 3047765 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_union_blob_256: total: calls: 1 - instructions: 30978105 + instructions: 28982642 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_union_blob_32: total: calls: 1 - instructions: 4651319 + instructions: 4313788 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_union_blob_512: total: calls: 1 - instructions: 56732800 + instructions: 53205989 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_union_blob_64: total: calls: 1 - instructions: 10033921 + instructions: 9210492 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_union_blob_8: total: calls: 1 - instructions: 3145373 + instructions: 2791177 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_union_u32: total: calls: 1 - instructions: 2269456 + instructions: 1900823 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreeset_union_u64: total: calls: 1 - instructions: 2269478 + instructions: 1969072 heap_increase: 0 stable_memory_increase: 0 scopes: {} diff --git a/benchmarks/nns/canbench_results.yml b/benchmarks/nns/canbench_results.yml index 91fda075..78e7a24d 100644 --- a/benchmarks/nns/canbench_results.yml +++ b/benchmarks/nns/canbench_results.yml @@ -58,56 +58,56 @@ benches: vote_cascading_stable_centralized_10k: total: calls: 1 - instructions: 1375361602 - heap_increase: 10 + instructions: 21591285 + heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_centralized_1k: total: calls: 1 - instructions: 99869278 - heap_increase: 1 + instructions: 2173774 + heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_chain_10k_15: total: calls: 1 - instructions: 9800292700 - heap_increase: 5 + instructions: 149539 + heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_chain_10k_5: total: calls: 1 - instructions: 3004791001 - heap_increase: 5 + instructions: 121684 + heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_chain_1k_15: total: calls: 1 - instructions: 865575963 + instructions: 122042 heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_chain_1k_5: total: calls: 1 - instructions: 252822713 + instructions: 93898 heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_single_vote_10k: total: calls: 1 - instructions: 91204 + instructions: 91222 heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_single_vote_1k: total: calls: 1 - instructions: 66626 + instructions: 66644 heap_increase: 0 stable_memory_increase: 0 scopes: {} From 604ba71b2ff64b2fd228f5ea9f92f31abc0d3ca5 Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Tue, 15 Jul 2025 16:30:20 +0200 Subject: [PATCH 06/32] fix rust version in CI --- .github/workflows/ci.yml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 58588b57..076e4ca9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,16 +2,13 @@ name: CI on: [pull_request] env: + RUST_VERSION: 1.84.0 CARGO_TERM_COLOR: always # Force Cargo to use colors TERM: xterm-256color jobs: build: runs-on: ubuntu-latest - strategy: - matrix: - rust: [1.84.0] - steps: - uses: actions/checkout@v4 @@ -28,8 +25,8 @@ jobs: - name: Install Rust run: | - rustup update ${{ matrix.rust }} --no-self-update - rustup default ${{ matrix.rust }} + rustup update $RUST_VERSION --no-self-update + rustup default $RUST_VERSION rustup component add rustfmt rustup component add clippy rustup toolchain install nightly @@ -68,8 +65,8 @@ jobs: - name: Install Rust run: | - rustup update ${{ matrix.rust }} --no-self-update - rustup default ${{ matrix.rust }} + rustup update $RUST_VERSION --no-self-update + rustup default $RUST_VERSION rustup target add wasm32-unknown-unknown - name: Install DFX @@ -135,8 +132,8 @@ jobs: - name: Install Rust run: | - rustup update ${{ matrix.rust || 'stable' }} --no-self-update - rustup default ${{ matrix.rust || 'stable' }} + rustup update $RUST_VERSION --no-self-update + rustup default $RUST_VERSION rustup target add wasm32-unknown-unknown - name: Benchmark From f827fa7549409f11f4a214e1f8d37eb46e2806fb Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Wed, 16 Jul 2025 07:54:17 +0200 Subject: [PATCH 07/32] revert nns canbench_results.yml --- benchmarks/nns/canbench_results.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/benchmarks/nns/canbench_results.yml b/benchmarks/nns/canbench_results.yml index 78e7a24d..91fda075 100644 --- a/benchmarks/nns/canbench_results.yml +++ b/benchmarks/nns/canbench_results.yml @@ -58,56 +58,56 @@ benches: vote_cascading_stable_centralized_10k: total: calls: 1 - instructions: 21591285 - heap_increase: 0 + instructions: 1375361602 + heap_increase: 10 stable_memory_increase: 0 scopes: {} vote_cascading_stable_centralized_1k: total: calls: 1 - instructions: 2173774 - heap_increase: 0 + instructions: 99869278 + heap_increase: 1 stable_memory_increase: 0 scopes: {} vote_cascading_stable_chain_10k_15: total: calls: 1 - instructions: 149539 - heap_increase: 0 + instructions: 9800292700 + heap_increase: 5 stable_memory_increase: 0 scopes: {} vote_cascading_stable_chain_10k_5: total: calls: 1 - instructions: 121684 - heap_increase: 0 + instructions: 3004791001 + heap_increase: 5 stable_memory_increase: 0 scopes: {} vote_cascading_stable_chain_1k_15: total: calls: 1 - instructions: 122042 + instructions: 865575963 heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_chain_1k_5: total: calls: 1 - instructions: 93898 + instructions: 252822713 heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_single_vote_10k: total: calls: 1 - instructions: 91222 + instructions: 91204 heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_single_vote_1k: total: calls: 1 - instructions: 66644 + instructions: 66626 heap_increase: 0 stable_memory_increase: 0 scopes: {} From e57932ca4beceed749da6e7075d309bd8c0b32a9 Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Wed, 16 Jul 2025 08:02:40 +0200 Subject: [PATCH 08/32] --persist --- benchmarks/nns/canbench_results.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/benchmarks/nns/canbench_results.yml b/benchmarks/nns/canbench_results.yml index 91fda075..78e7a24d 100644 --- a/benchmarks/nns/canbench_results.yml +++ b/benchmarks/nns/canbench_results.yml @@ -58,56 +58,56 @@ benches: vote_cascading_stable_centralized_10k: total: calls: 1 - instructions: 1375361602 - heap_increase: 10 + instructions: 21591285 + heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_centralized_1k: total: calls: 1 - instructions: 99869278 - heap_increase: 1 + instructions: 2173774 + heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_chain_10k_15: total: calls: 1 - instructions: 9800292700 - heap_increase: 5 + instructions: 149539 + heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_chain_10k_5: total: calls: 1 - instructions: 3004791001 - heap_increase: 5 + instructions: 121684 + heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_chain_1k_15: total: calls: 1 - instructions: 865575963 + instructions: 122042 heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_chain_1k_5: total: calls: 1 - instructions: 252822713 + instructions: 93898 heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_single_vote_10k: total: calls: 1 - instructions: 91204 + instructions: 91222 heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_single_vote_1k: total: calls: 1 - instructions: 66626 + instructions: 66644 heap_increase: 0 stable_memory_increase: 0 scopes: {} From aa1161fb895150209e6b08389c0af8e32b3e49eb Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Wed, 16 Jul 2025 08:04:25 +0200 Subject: [PATCH 09/32] add debug print --- scripts/ci_run_benchmark.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/ci_run_benchmark.sh b/scripts/ci_run_benchmark.sh index af5e4247..593d4277 100644 --- a/scripts/ci_run_benchmark.sh +++ b/scripts/ci_run_benchmark.sh @@ -57,6 +57,8 @@ has_updates() { # Check if the canbench results file is up to date. pushd "$CANISTER_PATH" +git log -n 5 --oneline + canbench --less-verbose --hide-results --show-summary --csv > "$CANBENCH_OUTPUT" cp "./canbench_results.csv" "$CANBENCH_RESULTS_CSV_FILE" if has_updates; then From 80b65ef93c861105b380764aa3fc208e1e67e5aa Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Wed, 16 Jul 2025 08:19:52 +0200 Subject: [PATCH 10/32] upload results yml --- .github/workflows/ci.yml | 6 ++++++ scripts/ci_run_benchmark.sh | 3 +++ 2 files changed, 9 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 076e4ca9..da0e6c94 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -150,6 +150,12 @@ jobs: name: canbench_results_${{ matrix.name }}_csv path: /tmp/canbench_results_${{ matrix.name }}.csv + # TODO: remove debug code. + - uses: actions/upload-artifact@v4 + with: + name: canbench_results_${{ matrix.name }}_yml + path: /tmp/canbench_results_${{ matrix.name }}.yml + - name: Pass or fail run: | bash ./scripts/ci_post_run_benchmark.sh diff --git a/scripts/ci_run_benchmark.sh b/scripts/ci_run_benchmark.sh index 593d4277..81cf2891 100644 --- a/scripts/ci_run_benchmark.sh +++ b/scripts/ci_run_benchmark.sh @@ -61,6 +61,9 @@ git log -n 5 --oneline canbench --less-verbose --hide-results --show-summary --csv > "$CANBENCH_OUTPUT" cp "./canbench_results.csv" "$CANBENCH_RESULTS_CSV_FILE" +# TODO: remove debug code. +cp "./canbench_results.yml" "/tmp/canbench_results_${CANBENCH_JOB_NAME}.yml" + if has_updates; then UPDATED_MSG="**❌ \`$CANBENCH_RESULTS_FILE\` is not up to date** If the performance change is expected, run \`canbench --persist [--csv]\` to update the benchmark results." From 53066cbd03489f94d5dea759c8d2956b704b08a8 Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Wed, 16 Jul 2025 08:36:51 +0200 Subject: [PATCH 11/32] upload before/after --- .github/workflows/ci.yml | 8 ++++++-- scripts/ci_run_benchmark.sh | 5 +++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da0e6c94..8a7b0d16 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -153,8 +153,12 @@ jobs: # TODO: remove debug code. - uses: actions/upload-artifact@v4 with: - name: canbench_results_${{ matrix.name }}_yml - path: /tmp/canbench_results_${{ matrix.name }}.yml + name: canbench_results_${{ matrix.name }}_yml_before + path: /tmp/canbench_results_${{ matrix.name }}_before.yml + - uses: actions/upload-artifact@v4 + with: + name: canbench_results_${{ matrix.name }}_yml_after + path: /tmp/canbench_results_${{ matrix.name }}_after.yml - name: Pass or fail run: | diff --git a/scripts/ci_run_benchmark.sh b/scripts/ci_run_benchmark.sh index 81cf2891..3c9d4ded 100644 --- a/scripts/ci_run_benchmark.sh +++ b/scripts/ci_run_benchmark.sh @@ -59,10 +59,11 @@ has_updates() { pushd "$CANISTER_PATH" git log -n 5 --oneline -canbench --less-verbose --hide-results --show-summary --csv > "$CANBENCH_OUTPUT" +cp "./canbench_results.yml" "/tmp/canbench_results_${CANBENCH_JOB_NAME}_before.yml" +canbench --less-verbose --hide-results --show-summary --csv --persist > "$CANBENCH_OUTPUT" cp "./canbench_results.csv" "$CANBENCH_RESULTS_CSV_FILE" # TODO: remove debug code. -cp "./canbench_results.yml" "/tmp/canbench_results_${CANBENCH_JOB_NAME}.yml" +cp "./canbench_results.yml" "/tmp/canbench_results_${CANBENCH_JOB_NAME}_after.yml" if has_updates; then UPDATED_MSG="**❌ \`$CANBENCH_RESULTS_FILE\` is not up to date** From b065cc31438a745df7c85dc4d9ba3fa3fd6d735d Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Wed, 16 Jul 2025 08:47:45 +0200 Subject: [PATCH 12/32] hardcode after results --- benchmarks/nns/canbench_results.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/benchmarks/nns/canbench_results.yml b/benchmarks/nns/canbench_results.yml index 78e7a24d..8c59c0ff 100644 --- a/benchmarks/nns/canbench_results.yml +++ b/benchmarks/nns/canbench_results.yml @@ -58,56 +58,56 @@ benches: vote_cascading_stable_centralized_10k: total: calls: 1 - instructions: 21591285 + instructions: 22034014 heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_centralized_1k: total: calls: 1 - instructions: 2173774 + instructions: 2218292 heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_chain_10k_15: total: calls: 1 - instructions: 149539 + instructions: 150207 heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_chain_10k_5: total: calls: 1 - instructions: 121684 + instructions: 122149 heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_chain_1k_15: total: calls: 1 - instructions: 122042 + instructions: 122677 heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_chain_1k_5: total: calls: 1 - instructions: 93898 + instructions: 94284 heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_single_vote_10k: total: calls: 1 - instructions: 91222 + instructions: 91466 heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_single_vote_1k: total: calls: 1 - instructions: 66644 + instructions: 66840 heap_increase: 0 stable_memory_increase: 0 scopes: {} From 91450146ba98a364e694c051c0de89e796ea1144 Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Wed, 16 Jul 2025 09:53:02 +0200 Subject: [PATCH 13/32] --persist --- benchmarks/nns/canbench_results.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/benchmarks/nns/canbench_results.yml b/benchmarks/nns/canbench_results.yml index 8c59c0ff..78e7a24d 100644 --- a/benchmarks/nns/canbench_results.yml +++ b/benchmarks/nns/canbench_results.yml @@ -58,56 +58,56 @@ benches: vote_cascading_stable_centralized_10k: total: calls: 1 - instructions: 22034014 + instructions: 21591285 heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_centralized_1k: total: calls: 1 - instructions: 2218292 + instructions: 2173774 heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_chain_10k_15: total: calls: 1 - instructions: 150207 + instructions: 149539 heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_chain_10k_5: total: calls: 1 - instructions: 122149 + instructions: 121684 heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_chain_1k_15: total: calls: 1 - instructions: 122677 + instructions: 122042 heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_chain_1k_5: total: calls: 1 - instructions: 94284 + instructions: 93898 heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_single_vote_10k: total: calls: 1 - instructions: 91466 + instructions: 91222 heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_single_vote_1k: total: calls: 1 - instructions: 66840 + instructions: 66644 heap_increase: 0 stable_memory_increase: 0 scopes: {} From 865236b183d8acd209ab03aa453b5e874b93d184 Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Wed, 16 Jul 2025 10:50:58 +0000 Subject: [PATCH 14/32] --persist ubuntu --- benchmarks/nns/canbench_results.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/benchmarks/nns/canbench_results.yml b/benchmarks/nns/canbench_results.yml index 78e7a24d..8c59c0ff 100644 --- a/benchmarks/nns/canbench_results.yml +++ b/benchmarks/nns/canbench_results.yml @@ -58,56 +58,56 @@ benches: vote_cascading_stable_centralized_10k: total: calls: 1 - instructions: 21591285 + instructions: 22034014 heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_centralized_1k: total: calls: 1 - instructions: 2173774 + instructions: 2218292 heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_chain_10k_15: total: calls: 1 - instructions: 149539 + instructions: 150207 heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_chain_10k_5: total: calls: 1 - instructions: 121684 + instructions: 122149 heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_chain_1k_15: total: calls: 1 - instructions: 122042 + instructions: 122677 heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_chain_1k_5: total: calls: 1 - instructions: 93898 + instructions: 94284 heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_single_vote_10k: total: calls: 1 - instructions: 91222 + instructions: 91466 heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_single_vote_1k: total: calls: 1 - instructions: 66644 + instructions: 66840 heap_increase: 0 stable_memory_increase: 0 scopes: {} From d0742ba05525518498a7bc2c5ee753f78bca7243 Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Thu, 17 Jul 2025 09:01:28 +0200 Subject: [PATCH 15/32] fix nns test --- benchmarks/nns/src/nns_vote_cascading.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/benchmarks/nns/src/nns_vote_cascading.rs b/benchmarks/nns/src/nns_vote_cascading.rs index 514c5196..d3545820 100644 --- a/benchmarks/nns/src/nns_vote_cascading.rs +++ b/benchmarks/nns/src/nns_vote_cascading.rs @@ -114,9 +114,8 @@ impl NeuronStore for StableNeuronStore { self.followers_index .range(min_key..=max_key) - //.map(|(((_topic, _followee_neuron_id), follower_neuron_id), _value)| follower_neuron_id) .map(|entry| { - let ((_, follower_neuron_id), _) = entry.key(); + let ((_topic, _followee_neuron_id), follower_neuron_id) = entry.key(); *follower_neuron_id }) .collect() From 33b3941fc87f7240afa7c7ebf373063ffc0c02c0 Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Thu, 17 Jul 2025 09:10:19 +0200 Subject: [PATCH 16/32] into_pair --- benchmarks/btreemap/src/main.rs | 3 +-- src/btreemap.rs | 7 +++---- src/btreemap/iter.rs | 4 ++++ 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/benchmarks/btreemap/src/main.rs b/benchmarks/btreemap/src/main.rs index 9b7e9413..167b973c 100644 --- a/benchmarks/btreemap/src/main.rs +++ b/benchmarks/btreemap/src/main.rs @@ -777,8 +777,7 @@ fn range_key_sum_helper_v2(count: usize, size: usize) -> BenchResult { bench_fn(|| { btree .range((Bound::Included(0), Bound::Included(size as u32))) - .map(|entry| (entry.key().clone(), entry.value())) - .map(|(k, _)| k) + .map(|entry| *entry.key()) .sum::() }) } diff --git a/src/btreemap.rs b/src/btreemap.rs index a74b266b..42a6bfb0 100644 --- a/src/btreemap.rs +++ b/src/btreemap.rs @@ -1377,8 +1377,7 @@ mod test { V: Storable + 'a, M: Memory + 'a, { - it.map(|entry| (entry.key().clone(), entry.value())) - .collect() + it.map(|entry| entry.into_pair()).collect() } /// Returns a fixed‑size buffer for the given u32. @@ -2997,7 +2996,7 @@ mod test { btree .iter_from_prev_key(&key(i + 1)) .next() - .map(|entry| (entry.key().clone(), entry.value())), + .map(|entry| entry.into_pair()), Some((key(i), value(i))), "failed to get an upper bound for key({})", i + 1 @@ -3007,7 +3006,7 @@ mod test { btree .iter_from_prev_key(&key(0)) .next() - .map(|entry| (entry.key().clone(), entry.value())), + .map(|entry| entry.into_pair()), None, "key(0) must not have an upper bound" ); diff --git a/src/btreemap/iter.rs b/src/btreemap/iter.rs index 01affeeb..8082b1cb 100644 --- a/src/btreemap/iter.rs +++ b/src/btreemap/iter.rs @@ -472,6 +472,10 @@ where let encoded_value = self.node.value(self.entry_idx, self.map.memory()); V::from_bytes(Cow::Borrowed(encoded_value)) } + + pub fn into_pair(self) -> (K, V) { + (self.key().clone(), self.value()) + } } pub struct Iter<'a, K, V, M>(IterInternal<'a, K, V, M>) From ef723c9289f8db3e6eac1854dafbb479072e0684 Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Thu, 17 Jul 2025 09:11:40 +0200 Subject: [PATCH 17/32] . --- src/btreemap/proptests.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/btreemap/proptests.rs b/src/btreemap/proptests.rs index b1f68509..0c3df592 100644 --- a/src/btreemap/proptests.rs +++ b/src/btreemap/proptests.rs @@ -220,10 +220,7 @@ fn execute_operation( let std_iter = std_btree.iter().skip(from).take(len); let mut stable_iter = btree.iter().skip(from).take(len); for (k1, v1) in std_iter { - let (k2, v2) = stable_iter - .next() - .map(|entry| (entry.key().clone(), entry.value())) - .unwrap(); + let (k2, v2) = stable_iter.next().map(|entry| entry.into_pair()).unwrap(); assert_eq!(k1, &k2); assert_eq!(v1, &v2); } From 50239f0cb6590bf2fa365031937a159bbde773b1 Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Thu, 17 Jul 2025 09:12:57 +0200 Subject: [PATCH 18/32] . --- src/btreemap/proptests.rs | 2 +- tests/api_conformance.rs | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/btreemap/proptests.rs b/src/btreemap/proptests.rs index 0c3df592..6d0ca6cf 100644 --- a/src/btreemap/proptests.rs +++ b/src/btreemap/proptests.rs @@ -150,7 +150,7 @@ fn map_iter_from_prev_key(#[strategy(pvec(0u64..u64::MAX -1 , 10..100))] keys: V Some((*k, ())), map.iter_from_prev_key(&(k + 1)) .next() - .map(|entry| (*entry.key(), entry.value())) + .map(|entry| entry.into_pair()) ); } diff --git a/tests/api_conformance.rs b/tests/api_conformance.rs index 3f81394c..6cf9c5b3 100644 --- a/tests/api_conformance.rs +++ b/tests/api_conformance.rs @@ -57,10 +57,7 @@ fn api_conformance_btreemap() { // Iterators. // Note: stable.iter() yields (K, V), std.iter() yields (&K, &V) - let stable_items: std::vec::Vec<_> = stable - .iter() - .map(|entry| (*entry.key(), entry.value())) - .collect(); + let stable_items: std::vec::Vec<_> = stable.iter().map(|entry| entry.into_pair()).collect(); let std_items: std::vec::Vec<_> = std.iter().map(|(k, v)| (*k, v.clone())).collect(); assert_eq!(stable_items, std_items); @@ -98,7 +95,7 @@ fn api_conformance_btreemap() { let stable_range: std::vec::Vec<_> = stable .range(range_start..range_end) - .map(|entry| (*entry.key(), entry.value())) + .map(|entry| entry.into_pair()) .collect(); let std_range: std::vec::Vec<_> = std .range(range_start..range_end) @@ -131,7 +128,7 @@ fn api_conformance_btreemap() { let bound = 5; let stable_result: std::vec::Vec<_> = stable .iter_from_prev_key(&bound) - .map(|entry| (*entry.key(), entry.value())) + .map(|entry| entry.into_pair()) .collect(); let std_result: std::vec::Vec<_> = if let Some((start, _)) = std.range(..bound).next_back() { std.range(start..).map(|(k, v)| (*k, v.clone())).collect() From 4ecf07e7e2a7a998cf67c7419218aec36958682d Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Thu, 17 Jul 2025 09:14:06 +0200 Subject: [PATCH 19/32] . --- src/btreemap/proptests.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/btreemap/proptests.rs b/src/btreemap/proptests.rs index 6d0ca6cf..c99e5639 100644 --- a/src/btreemap/proptests.rs +++ b/src/btreemap/proptests.rs @@ -239,10 +239,7 @@ fn execute_operation( let std_iter = std_btree.iter().rev().skip(from).take(len); let mut stable_iter = btree.iter().rev().skip(from).take(len); for (k1, v1) in std_iter { - let (k2, v2) = stable_iter - .next() - .map(|entry| (entry.key().clone(), entry.value())) - .unwrap(); + let (k2, v2) = stable_iter.next().map(|entry| entry.into_pair()).unwrap(); assert_eq!(k1, &k2); assert_eq!(v1, &v2); } @@ -296,7 +293,7 @@ fn execute_operation( .skip(idx) .take(1) .next() - .map(|entry| (entry.key().clone(), entry.value())) + .map(|entry| entry.into_pair()) { eprintln!("Get({})", hex::encode(&k)); assert_eq!(std_btree.get(&k), Some(&v)); @@ -316,7 +313,7 @@ fn execute_operation( .skip(idx) .take(1) .next() - .map(|entry| (entry.key().clone(), entry.value())) + .map(|entry| entry.into_pair()) { eprintln!("Remove({})", hex::encode(&k)); assert_eq!(std_btree.remove(&k), Some(v.clone())); @@ -339,7 +336,7 @@ fn execute_operation( .skip(from) .take(1) .next() - .map(|entry| (entry.key().clone(), entry.value())) + .map(|entry| entry.into_pair()) .unwrap() .0 .clone(); @@ -348,7 +345,7 @@ fn execute_operation( .skip(end) .take(1) .next() - .map(|entry| (entry.key().clone(), entry.value())) + .map(|entry| entry.into_pair()) .unwrap() .0 .clone(); From dceb31668e6974c9efe1f8d5974fb4219988ef5a Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Thu, 17 Jul 2025 09:17:49 +0200 Subject: [PATCH 20/32] . --- src/btreemap/proptests.rs | 10 ++++++---- src/btreeset.rs | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/btreemap/proptests.rs b/src/btreemap/proptests.rs index c99e5639..99a34b22 100644 --- a/src/btreemap/proptests.rs +++ b/src/btreemap/proptests.rs @@ -349,7 +349,9 @@ fn execute_operation( .unwrap() .0 .clone(); - let stable_range = btree.range(range_start..range_end); + let stable_range = btree + .range(range_start..range_end) + .map(|entry| entry.into_pair()); // Create a range for the std btree from the keys at indexes `from` and `end`. let range_start = std_btree @@ -363,9 +365,9 @@ fn execute_operation( let range_end = std_btree.iter().skip(end).take(1).next().unwrap().0.clone(); let std_range = std_btree.range(range_start..range_end); - for ((k1, v1), entry2) in std_range.zip(stable_range) { - assert_eq!(k1, entry2.key()); - assert_eq!(*v1, entry2.value()); + for ((k1, v1), (k2, v2)) in std_range.zip(stable_range) { + assert_eq!(*k1, k2); + assert_eq!(*v1, v2); } } Operation::PopLast => { diff --git a/src/btreeset.rs b/src/btreeset.rs index d111cd7d..d4853b15 100644 --- a/src/btreeset.rs +++ b/src/btreeset.rs @@ -35,7 +35,7 @@ where type Item = K; fn next(&mut self) -> Option { - self.iter_internal.next().map(|entry| entry.key().clone()) // TODO: maybe iterate over keys only? + self.iter_internal.next().map(|entry| entry.key().clone()) } } From 1bcf91a8f2f1e191d93256f5d1d2269e1e5f8a17 Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Thu, 17 Jul 2025 09:18:29 +0200 Subject: [PATCH 21/32] . --- src/btreemap/proptests.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/btreemap/proptests.rs b/src/btreemap/proptests.rs index 99a34b22..4403a42b 100644 --- a/src/btreemap/proptests.rs +++ b/src/btreemap/proptests.rs @@ -366,8 +366,8 @@ fn execute_operation( let std_range = std_btree.range(range_start..range_end); for ((k1, v1), (k2, v2)) in std_range.zip(stable_range) { - assert_eq!(*k1, k2); - assert_eq!(*v1, v2); + assert_eq!(k1, &k2); + assert_eq!(v1, &v2); } } Operation::PopLast => { From 7b36a58c0fa49ccd56b3c23155a9e9874211c410 Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Thu, 17 Jul 2025 07:21:50 +0000 Subject: [PATCH 22/32] --persist --- benchmarks/nns/canbench_results.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/benchmarks/nns/canbench_results.yml b/benchmarks/nns/canbench_results.yml index 8c59c0ff..4186b23d 100644 --- a/benchmarks/nns/canbench_results.yml +++ b/benchmarks/nns/canbench_results.yml @@ -58,42 +58,42 @@ benches: vote_cascading_stable_centralized_10k: total: calls: 1 - instructions: 22034014 - heap_increase: 0 + instructions: 1375501036 + heap_increase: 10 stable_memory_increase: 0 scopes: {} vote_cascading_stable_centralized_1k: total: calls: 1 - instructions: 2218292 - heap_increase: 0 + instructions: 99996435 + heap_increase: 1 stable_memory_increase: 0 scopes: {} vote_cascading_stable_chain_10k_15: total: calls: 1 - instructions: 150207 - heap_increase: 0 + instructions: 9819218496 + heap_increase: 5 stable_memory_increase: 0 scopes: {} vote_cascading_stable_chain_10k_5: total: calls: 1 - instructions: 122149 - heap_increase: 0 + instructions: 3007431336 + heap_increase: 5 stable_memory_increase: 0 scopes: {} vote_cascading_stable_chain_1k_15: total: calls: 1 - instructions: 122677 + instructions: 867330736 heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_chain_1k_5: total: calls: 1 - instructions: 94284 + instructions: 253041123 heap_increase: 0 stable_memory_increase: 0 scopes: {} From 3d50ed16d052e3e59f23a80d9cad4f09568df22c Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Thu, 17 Jul 2025 09:30:03 +0200 Subject: [PATCH 23/32] --persist on macos --- benchmarks/btreemap/canbench_results.yml | 598 +++++++++++------------ benchmarks/nns/canbench_results.yml | 16 +- 2 files changed, 307 insertions(+), 307 deletions(-) diff --git a/benchmarks/btreemap/canbench_results.yml b/benchmarks/btreemap/canbench_results.yml index 8ec6ffc6..2dabed3e 100644 --- a/benchmarks/btreemap/canbench_results.yml +++ b/benchmarks/btreemap/canbench_results.yml @@ -2,903 +2,903 @@ benches: btreemap_v2_contains_10mib_values: total: calls: 1 - instructions: 146994443 + instructions: 142210325 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_blob8_u64: total: calls: 1 - instructions: 277297908 + instructions: 277134712 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_blob_1024_128: total: calls: 1 - instructions: 4278409559 + instructions: 4278312217 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_blob_128_128: total: calls: 1 - instructions: 819382999 + instructions: 819285681 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_blob_16_128: total: calls: 1 - instructions: 293840411 + instructions: 293742975 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_blob_256_128: total: calls: 1 - instructions: 1310782619 + instructions: 1310685287 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_blob_32_0: total: calls: 1 - instructions: 329670151 + instructions: 329571719 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_blob_32_1024: total: calls: 1 - instructions: 326169465 + instructions: 326072097 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_blob_32_128: total: calls: 1 - instructions: 326339716 + instructions: 326242314 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_blob_32_16: total: calls: 1 - instructions: 318921323 + instructions: 318823973 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_blob_32_256: total: calls: 1 - instructions: 324123767 + instructions: 324026367 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_blob_32_32: total: calls: 1 - instructions: 331069337 + instructions: 330971981 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_blob_32_4: total: calls: 1 - instructions: 323143453 + instructions: 323046095 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_blob_32_512: total: calls: 1 - instructions: 321740587 + instructions: 321643229 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_blob_32_64: total: calls: 1 - instructions: 324982674 + instructions: 324885334 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_blob_32_8: total: calls: 1 - instructions: 324406268 + instructions: 324308878 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_blob_4_128: total: calls: 1 - instructions: 243961485 + instructions: 243884967 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_blob_512_128: total: calls: 1 - instructions: 2281591609 + instructions: 2281494289 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_blob_64_128: total: calls: 1 - instructions: 403367950 + instructions: 403270584 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_blob_8_128: total: calls: 1 - instructions: 268183463 + instructions: 268086207 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_principal: total: calls: 1 - instructions: 349175694 + instructions: 349062610 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_u64_blob8: total: calls: 1 - instructions: 219726441 + instructions: 219629119 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_u64_u64: total: calls: 1 - instructions: 223420764 + instructions: 223284326 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_u64_vec8: total: calls: 1 - instructions: 219726441 + instructions: 219629119 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_vec8_u64: total: calls: 1 - instructions: 374193078 + instructions: 374095890 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_vec_1024_128: total: calls: 1 - instructions: 1819014928 + instructions: 1817385622 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_vec_128_128: total: calls: 1 - instructions: 568693397 + instructions: 568150650 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_vec_16_128: total: calls: 1 - instructions: 443198270 + instructions: 442851826 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_vec_256_128: total: calls: 1 - instructions: 897089684 + instructions: 896432175 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_vec_32_0: total: calls: 1 - instructions: 355419003 + instructions: 355321635 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_vec_32_1024: total: calls: 1 - instructions: 522016102 + instructions: 520527229 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_vec_32_128: total: calls: 1 - instructions: 428737249 + instructions: 428325937 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_vec_32_16: total: calls: 1 - instructions: 367899502 + instructions: 367802150 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_vec_32_256: total: calls: 1 - instructions: 433632922 + instructions: 433045196 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_vec_32_32: total: calls: 1 - instructions: 355373825 + instructions: 355276471 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_vec_32_4: total: calls: 1 - instructions: 352658656 + instructions: 352561298 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_vec_32_512: total: calls: 1 - instructions: 455714924 + instructions: 454924839 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_vec_32_64: total: calls: 1 - instructions: 398551250 + instructions: 398356880 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_vec_32_8: total: calls: 1 - instructions: 352724065 + instructions: 352626675 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_vec_4_128: total: calls: 1 - instructions: 404615996 + instructions: 404252150 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_vec_512_128: total: calls: 1 - instructions: 1247777789 + instructions: 1246829046 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_vec_64_128: total: calls: 1 - instructions: 493694675 + instructions: 493185629 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_contains_vec_8_128: total: calls: 1 - instructions: 396899411 + instructions: 396603085 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_10mib_values: total: calls: 1 - instructions: 393376922 + instructions: 388592804 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_blob8_u64: total: calls: 1 - instructions: 299762837 + instructions: 299599641 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_blob_1024_128: total: calls: 1 - instructions: 4457782849 + instructions: 4457685507 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_blob_128_128: total: calls: 1 - instructions: 855371125 + instructions: 855273807 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_blob_16_128: total: calls: 1 - instructions: 308561189 + instructions: 308463753 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_blob_256_128: total: calls: 1 - instructions: 1367149809 + instructions: 1367052477 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_blob_32_0: total: calls: 1 - instructions: 337528382 + instructions: 337429950 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_blob_32_1024: total: calls: 1 - instructions: 350605701 + instructions: 350508333 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_blob_32_128: total: calls: 1 - instructions: 341750664 + instructions: 341653262 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_blob_32_16: total: calls: 1 - instructions: 330748540 + instructions: 330651190 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_blob_32_256: total: calls: 1 - instructions: 342741124 + instructions: 342643724 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_blob_32_32: total: calls: 1 - instructions: 342794606 + instructions: 342697250 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_blob_32_4: total: calls: 1 - instructions: 334266384 + instructions: 334169026 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_blob_32_512: total: calls: 1 - instructions: 342792757 + instructions: 342695399 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_blob_32_64: total: calls: 1 - instructions: 336911275 + instructions: 336813935 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_blob_32_8: total: calls: 1 - instructions: 336022455 + instructions: 335925065 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_blob_4_128: total: calls: 1 - instructions: 254982629 + instructions: 254906111 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_blob_512_128: total: calls: 1 - instructions: 2378925834 + instructions: 2378828514 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_blob_64_128: total: calls: 1 - instructions: 428842219 + instructions: 428744853 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_blob_8_128: total: calls: 1 - instructions: 279813599 + instructions: 279716343 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_principal: total: calls: 1 - instructions: 356541286 + instructions: 356428202 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_u64_blob8: total: calls: 1 - instructions: 226543736 + instructions: 226446414 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_u64_u64: total: calls: 1 - instructions: 230671190 + instructions: 230534752 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_u64_vec8: total: calls: 1 - instructions: 227032932 + instructions: 226935610 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_vec8_u64: total: calls: 1 - instructions: 379748851 + instructions: 379651663 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_vec_1024_128: total: calls: 1 - instructions: 1872435821 + instructions: 1870806515 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_vec_128_128: total: calls: 1 - instructions: 577769785 + instructions: 577227038 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_vec_16_128: total: calls: 1 - instructions: 450084168 + instructions: 449737724 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_vec_256_128: total: calls: 1 - instructions: 906327116 + instructions: 905669607 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_vec_32_0: total: calls: 1 - instructions: 358314026 + instructions: 358216658 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_vec_32_1024: total: calls: 1 - instructions: 545958359 + instructions: 544469486 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_vec_32_128: total: calls: 1 - instructions: 436449279 + instructions: 436037967 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_vec_32_16: total: calls: 1 - instructions: 373810922 + instructions: 373713570 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_vec_32_256: total: calls: 1 - instructions: 447739345 + instructions: 447151619 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_vec_32_32: total: calls: 1 - instructions: 361428053 + instructions: 361330699 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_vec_32_4: total: calls: 1 - instructions: 358445667 + instructions: 358348309 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_vec_32_512: total: calls: 1 - instructions: 473782178 + instructions: 472992093 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_vec_32_64: total: calls: 1 - instructions: 405006256 + instructions: 404811886 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_vec_32_8: total: calls: 1 - instructions: 358554012 + instructions: 358456622 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_vec_4_128: total: calls: 1 - instructions: 411515721 + instructions: 411151875 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_vec_512_128: total: calls: 1 - instructions: 1257098604 + instructions: 1256149861 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_vec_64_128: total: calls: 1 - instructions: 502196297 + instructions: 501687251 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_get_vec_8_128: total: calls: 1 - instructions: 403792480 + instructions: 403496154 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_insert_10mib_values: total: calls: 1 - instructions: 4393895240 + instructions: 4388592719 heap_increase: 161 stable_memory_increase: 3613 scopes: {} btreemap_v2_insert_blob8_u64: total: calls: 1 - instructions: 437964614 + instructions: 436633391 heap_increase: 0 stable_memory_increase: 4 scopes: {} btreemap_v2_insert_blob_1024_128: total: calls: 1 - instructions: 5497586809 + instructions: 5496222167 heap_increase: 0 stable_memory_increase: 196 scopes: {} btreemap_v2_insert_blob_128_128: total: calls: 1 - instructions: 1182202900 + instructions: 1180838234 heap_increase: 0 stable_memory_increase: 46 scopes: {} btreemap_v2_insert_blob_16_128: total: calls: 1 - instructions: 487577318 + instructions: 486249812 heap_increase: 0 stable_memory_increase: 24 scopes: {} btreemap_v2_insert_blob_256_128: total: calls: 1 - instructions: 1790404779 + instructions: 1789038066 heap_increase: 0 stable_memory_increase: 67 scopes: {} btreemap_v2_insert_blob_32_0: total: calls: 1 - instructions: 491805123 + instructions: 490459106 heap_increase: 0 stable_memory_increase: 8 scopes: {} btreemap_v2_insert_blob_32_1024: total: calls: 1 - instructions: 704849715 + instructions: 703500065 heap_increase: 0 stable_memory_increase: 173 scopes: {} btreemap_v2_insert_blob_32_128: total: calls: 1 - instructions: 543913855 + instructions: 542568143 heap_increase: 0 stable_memory_increase: 28 scopes: {} btreemap_v2_insert_blob_32_16: total: calls: 1 - instructions: 520474321 + instructions: 519117156 heap_increase: 0 stable_memory_increase: 11 scopes: {} btreemap_v2_insert_blob_32_256: total: calls: 1 - instructions: 572041599 + instructions: 570690137 heap_increase: 0 stable_memory_increase: 49 scopes: {} btreemap_v2_insert_blob_32_32: total: calls: 1 - instructions: 530304259 + instructions: 528951192 heap_increase: 0 stable_memory_increase: 13 scopes: {} btreemap_v2_insert_blob_32_4: total: calls: 1 - instructions: 510730548 + instructions: 509380036 heap_increase: 0 stable_memory_increase: 8 scopes: {} btreemap_v2_insert_blob_32_512: total: calls: 1 - instructions: 611412954 + instructions: 610063051 heap_increase: 0 stable_memory_increase: 91 scopes: {} btreemap_v2_insert_blob_32_64: total: calls: 1 - instructions: 536272645 + instructions: 534921249 heap_increase: 0 stable_memory_increase: 18 scopes: {} btreemap_v2_insert_blob_32_8: total: calls: 1 - instructions: 518938257 + instructions: 517593840 heap_increase: 0 stable_memory_increase: 9 scopes: {} btreemap_v2_insert_blob_4_128: total: calls: 1 - instructions: 408464336 + instructions: 407268940 heap_increase: 0 stable_memory_increase: 13 scopes: {} btreemap_v2_insert_blob_512_128: total: calls: 1 - instructions: 3042590891 + instructions: 3041223382 heap_increase: 0 stable_memory_increase: 111 scopes: {} btreemap_v2_insert_blob_64_128: total: calls: 1 - instructions: 662540780 + instructions: 661179485 heap_increase: 0 stable_memory_increase: 34 scopes: {} btreemap_v2_insert_blob_8_128: total: calls: 1 - instructions: 459911504 + instructions: 458615568 heap_increase: 0 stable_memory_increase: 20 scopes: {} btreemap_v2_insert_principal: total: calls: 1 - instructions: 504676710 + instructions: 503308324 heap_increase: 0 stable_memory_increase: 8 scopes: {} btreemap_v2_insert_u64_blob8: total: calls: 1 - instructions: 407793709 + instructions: 406744693 heap_increase: 0 stable_memory_increase: 5 scopes: {} btreemap_v2_insert_u64_u64: total: calls: 1 - instructions: 415652170 + instructions: 414580548 heap_increase: 0 stable_memory_increase: 6 scopes: {} btreemap_v2_insert_u64_vec8: total: calls: 1 - instructions: 411420090 + instructions: 410372254 heap_increase: 0 stable_memory_increase: 21 scopes: {} btreemap_v2_insert_vec8_u64: total: calls: 1 - instructions: 595396789 + instructions: 594103663 heap_increase: 0 stable_memory_increase: 16 scopes: {} btreemap_v2_insert_vec_1024_128: total: calls: 1 - instructions: 2746997363 + instructions: 2744606200 heap_increase: 0 stable_memory_increase: 193 scopes: {} btreemap_v2_insert_vec_128_128: total: calls: 1 - instructions: 1014206877 + instructions: 1012643373 heap_increase: 0 stable_memory_increase: 51 scopes: {} btreemap_v2_insert_vec_16_128: total: calls: 1 - instructions: 710493786 + instructions: 708997439 heap_increase: 0 stable_memory_increase: 31 scopes: {} btreemap_v2_insert_vec_256_128: total: calls: 1 - instructions: 1403786622 + instructions: 1402219761 heap_increase: 0 stable_memory_increase: 71 scopes: {} btreemap_v2_insert_vec_32_0: total: calls: 1 - instructions: 623195765 + instructions: 621849784 heap_increase: 0 stable_memory_increase: 20 scopes: {} btreemap_v2_insert_vec_32_1024: total: calls: 1 - instructions: 1184610264 + instructions: 1182132701 heap_increase: 0 stable_memory_increase: 171 scopes: {} btreemap_v2_insert_vec_32_128: total: calls: 1 - instructions: 757646787 + instructions: 756106158 heap_increase: 0 stable_memory_increase: 33 scopes: {} btreemap_v2_insert_vec_32_16: total: calls: 1 - instructions: 667548104 + instructions: 666191903 heap_increase: 0 stable_memory_increase: 20 scopes: {} btreemap_v2_insert_vec_32_256: total: calls: 1 - instructions: 870894717 + instructions: 869225881 heap_increase: 0 stable_memory_increase: 54 scopes: {} btreemap_v2_insert_vec_32_32: total: calls: 1 - instructions: 662998461 + instructions: 661645394 heap_increase: 0 stable_memory_increase: 20 scopes: {} btreemap_v2_insert_vec_32_4: total: calls: 1 - instructions: 661704365 + instructions: 660354036 heap_increase: 0 stable_memory_increase: 20 scopes: {} btreemap_v2_insert_vec_32_512: total: calls: 1 - instructions: 975520187 + instructions: 973664463 heap_increase: 0 stable_memory_increase: 91 scopes: {} btreemap_v2_insert_vec_32_64: total: calls: 1 - instructions: 693064409 + instructions: 691643081 heap_increase: 0 stable_memory_increase: 24 scopes: {} btreemap_v2_insert_vec_32_8: total: calls: 1 - instructions: 661190300 + instructions: 659845953 heap_increase: 0 stable_memory_increase: 20 scopes: {} btreemap_v2_insert_vec_4_128: total: calls: 1 - instructions: 605724847 + instructions: 604355928 heap_increase: 0 stable_memory_increase: 16 scopes: {} btreemap_v2_insert_vec_512_128: total: calls: 1 - instructions: 1860966136 + instructions: 1859161681 heap_increase: 0 stable_memory_increase: 112 scopes: {} btreemap_v2_insert_vec_64_128: total: calls: 1 - instructions: 847931143 + instructions: 846320282 heap_increase: 0 stable_memory_increase: 41 scopes: {} btreemap_v2_insert_vec_8_128: total: calls: 1 - instructions: 667744222 + instructions: 666289233 heap_increase: 0 stable_memory_increase: 23 scopes: {} @@ -919,21 +919,21 @@ benches: btreemap_v2_mem_manager_contains_u64_u64: total: calls: 1 - instructions: 283547624 + instructions: 283522171 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_contains_u64_vec512: total: calls: 1 - instructions: 367207972 + instructions: 367041614 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_contains_vec512_u64: total: calls: 1 - instructions: 1202831521 + instructions: 1201243952 heap_increase: 0 stable_memory_increase: 0 scopes: {} @@ -954,1169 +954,1169 @@ benches: btreemap_v2_mem_manager_get_u64_u64: total: calls: 1 - instructions: 291744284 + instructions: 291718588 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_get_u64_vec512: total: calls: 1 - instructions: 389034775 + instructions: 388831325 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_get_vec512_u64: total: calls: 1 - instructions: 1243929644 + instructions: 1242312078 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_insert_blob512_u64: total: calls: 1 - instructions: 3127471976 + instructions: 3127680452 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_insert_u64_blob512: total: calls: 1 - instructions: 607078432 + instructions: 607288370 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_insert_u64_u64: total: calls: 1 - instructions: 520351629 + instructions: 520545864 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_insert_u64_vec512: total: calls: 1 - instructions: 834231288 + instructions: 834100595 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_insert_vec512_u64: total: calls: 1 - instructions: 1966051747 + instructions: 1964405448 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_remove_blob512_u64: total: calls: 1 - instructions: 4309901195 + instructions: 4310221225 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_remove_u64_blob512: total: calls: 1 - instructions: 882652080 + instructions: 882970074 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_remove_u64_u64: total: calls: 1 - instructions: 736514798 + instructions: 736785650 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_remove_u64_vec512: total: calls: 1 - instructions: 1223922287 + instructions: 1223804753 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_mem_manager_remove_vec512_u64: total: calls: 1 - instructions: 3086440829 + instructions: 3084565257 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob8_u64: total: calls: 1 - instructions: 600984469 + instructions: 599256189 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_1024_128: total: calls: 1 - instructions: 8389699808 + instructions: 8387602842 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_128_128: total: calls: 1 - instructions: 1826791637 + instructions: 1824725965 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_16_128: total: calls: 1 - instructions: 744953359 + instructions: 743084112 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_256_128: total: calls: 1 - instructions: 2766001871 + instructions: 2763911828 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_32_0: total: calls: 1 - instructions: 753499341 + instructions: 751497584 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_32_1024: total: calls: 1 - instructions: 1123483257 + instructions: 1121481321 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_32_128: total: calls: 1 - instructions: 862303750 + instructions: 860285162 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_32_16: total: calls: 1 - instructions: 797081885 + instructions: 795095715 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_32_256: total: calls: 1 - instructions: 893745590 + instructions: 891739804 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_32_32: total: calls: 1 - instructions: 810546584 + instructions: 808560505 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_32_4: total: calls: 1 - instructions: 780860323 + instructions: 778864648 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_32_512: total: calls: 1 - instructions: 959564386 + instructions: 957571175 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_32_64: total: calls: 1 - instructions: 819393436 + instructions: 817406508 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_32_8: total: calls: 1 - instructions: 798800344 + instructions: 796779002 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_4_128: total: calls: 1 - instructions: 372504352 + instructions: 371435725 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_512_128: total: calls: 1 - instructions: 4615784181 + instructions: 4613700344 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_64_128: total: calls: 1 - instructions: 1033746155 + instructions: 1031695256 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_blob_8_128: total: calls: 1 - instructions: 606579846 + instructions: 604976184 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_principal: total: calls: 1 - instructions: 802260561 + instructions: 800191973 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_u64_blob8: total: calls: 1 - instructions: 670935050 + instructions: 669276877 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_u64_u64: total: calls: 1 - instructions: 682969871 + instructions: 681264462 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_u64_vec8: total: calls: 1 - instructions: 673450744 + instructions: 671829217 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec8_u64: total: calls: 1 - instructions: 784507353 + instructions: 782876135 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_1024_128: total: calls: 1 - instructions: 4053201799 + instructions: 4049265076 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_128_128: total: calls: 1 - instructions: 1505757042 + instructions: 1503218744 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_16_128: total: calls: 1 - instructions: 1026906349 + instructions: 1024772148 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_256_128: total: calls: 1 - instructions: 2022457349 + instructions: 2019891066 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_32_0: total: calls: 1 - instructions: 864943154 + instructions: 862946599 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_32_1024: total: calls: 1 - instructions: 1693750095 + instructions: 1689829372 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_32_128: total: calls: 1 - instructions: 1091338398 + instructions: 1088869698 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_32_16: total: calls: 1 - instructions: 930257229 + instructions: 928270806 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_32_256: total: calls: 1 - instructions: 1218069203 + instructions: 1215466767 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_32_32: total: calls: 1 - instructions: 933013579 + instructions: 931028208 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_32_4: total: calls: 1 - instructions: 916739142 + instructions: 914745699 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_32_512: total: calls: 1 - instructions: 1376183677 + instructions: 1373268399 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_32_64: total: calls: 1 - instructions: 974870391 + instructions: 972735601 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_32_8: total: calls: 1 - instructions: 926988022 + instructions: 924967663 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_4_128: total: calls: 1 - instructions: 542189616 + instructions: 540984708 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_512_128: total: calls: 1 - instructions: 2719276737 + instructions: 2716330411 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_64_128: total: calls: 1 - instructions: 1237055704 + instructions: 1234556907 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_first_vec_8_128: total: calls: 1 - instructions: 852559775 + instructions: 850734232 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob8_u64: total: calls: 1 - instructions: 577386453 + instructions: 575661530 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_1024_128: total: calls: 1 - instructions: 8057349727 + instructions: 8055247791 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_128_128: total: calls: 1 - instructions: 1757576966 + instructions: 1755509118 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_16_128: total: calls: 1 - instructions: 718424421 + instructions: 716556083 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_256_128: total: calls: 1 - instructions: 2671818382 + instructions: 2669730307 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_32_0: total: calls: 1 - instructions: 725344017 + instructions: 723335313 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_32_1024: total: calls: 1 - instructions: 1087450383 + instructions: 1085450731 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_32_128: total: calls: 1 - instructions: 827921914 + instructions: 825902306 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_32_16: total: calls: 1 - instructions: 768885285 + instructions: 766901397 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_32_256: total: calls: 1 - instructions: 862884553 + instructions: 860879651 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_32_32: total: calls: 1 - instructions: 777918755 + instructions: 775936416 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_32_4: total: calls: 1 - instructions: 757127700 + instructions: 755124599 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_32_512: total: calls: 1 - instructions: 934313226 + instructions: 932320719 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_32_64: total: calls: 1 - instructions: 793533814 + instructions: 791545690 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_32_8: total: calls: 1 - instructions: 770184951 + instructions: 768161716 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_4_128: total: calls: 1 - instructions: 358951666 + instructions: 357885021 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_512_128: total: calls: 1 - instructions: 4446650571 + instructions: 4444567386 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_64_128: total: calls: 1 - instructions: 1001786772 + instructions: 999738711 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_blob_8_128: total: calls: 1 - instructions: 600548987 + instructions: 598942864 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_principal: total: calls: 1 - instructions: 782358691 + instructions: 780291969 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_u64_blob8: total: calls: 1 - instructions: 647470766 + instructions: 645812582 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_u64_u64: total: calls: 1 - instructions: 659159226 + instructions: 657455588 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_u64_vec8: total: calls: 1 - instructions: 649889002 + instructions: 648268033 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec8_u64: total: calls: 1 - instructions: 761178344 + instructions: 759547094 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_1024_128: total: calls: 1 - instructions: 4258755882 + instructions: 4254818123 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_128_128: total: calls: 1 - instructions: 1512184524 + instructions: 1509650210 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_16_128: total: calls: 1 - instructions: 1008272591 + instructions: 1006125814 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_256_128: total: calls: 1 - instructions: 2075921754 + instructions: 2073363853 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_32_0: total: calls: 1 - instructions: 848111599 + instructions: 846109662 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_32_1024: total: calls: 1 - instructions: 1668346209 + instructions: 1664437667 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_32_128: total: calls: 1 - instructions: 1067076377 + instructions: 1064611264 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_32_16: total: calls: 1 - instructions: 904958510 + instructions: 902974455 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_32_256: total: calls: 1 - instructions: 1196045296 + instructions: 1193452039 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_32_32: total: calls: 1 - instructions: 912472018 + instructions: 910490347 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_32_4: total: calls: 1 - instructions: 900986325 + instructions: 898985596 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_32_512: total: calls: 1 - instructions: 1359834458 + instructions: 1356914135 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_32_64: total: calls: 1 - instructions: 951915781 + instructions: 949782755 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_32_8: total: calls: 1 - instructions: 904495679 + instructions: 902473492 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_4_128: total: calls: 1 - instructions: 528265894 + instructions: 527064939 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_512_128: total: calls: 1 - instructions: 2811118797 + instructions: 2808165041 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_64_128: total: calls: 1 - instructions: 1223314103 + instructions: 1220824533 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_pop_last_vec_8_128: total: calls: 1 - instructions: 852451588 + instructions: 850619579 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_range_count_1k_0b: total: calls: 1 - instructions: 16947 + instructions: 16962 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_range_count_1k_10kib: total: calls: 1 - instructions: 2548132 + instructions: 2507196 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_range_count_20_10mib: total: calls: 1 - instructions: 19090139 + instructions: 18468765 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_range_key_sum_1k_0b: total: calls: 1 - instructions: 17399 + instructions: 16933 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_range_key_sum_1k_10kib: total: calls: 1 - instructions: 56907005 + instructions: 2572994 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_range_key_sum_20_10mib: total: calls: 1 - instructions: 1104336722 + instructions: 18469999 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_range_value_sum_1k_0b: total: calls: 1 - instructions: 17289 + instructions: 17300 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_range_value_sum_1k_10kib: total: calls: 1 - instructions: 20708891 + instructions: 20668618 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_range_value_sum_20_10mib: total: calls: 1 - instructions: 398926591 + instructions: 398305226 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_10mib_values: total: calls: 1 - instructions: 4715220476 + instructions: 4711118385 heap_increase: 0 stable_memory_increase: 657 scopes: {} btreemap_v2_remove_blob8_u64: total: calls: 1 - instructions: 586740933 + instructions: 584636969 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_1024_128: total: calls: 1 - instructions: 7366276007 + instructions: 7363800309 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_128_128: total: calls: 1 - instructions: 1591208353 + instructions: 1588756329 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_16_128: total: calls: 1 - instructions: 667670809 + instructions: 665337905 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_256_128: total: calls: 1 - instructions: 2424157337 + instructions: 2421697300 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_32_0: total: calls: 1 - instructions: 656670864 + instructions: 654250005 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_32_1024: total: calls: 1 - instructions: 987710153 + instructions: 985325869 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_32_128: total: calls: 1 - instructions: 748986080 + instructions: 746608890 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_32_16: total: calls: 1 - instructions: 702426862 + instructions: 700059994 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_32_256: total: calls: 1 - instructions: 786500153 + instructions: 784125701 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_32_32: total: calls: 1 - instructions: 714296575 + instructions: 711919498 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_32_4: total: calls: 1 - instructions: 698620572 + instructions: 696214241 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_32_512: total: calls: 1 - instructions: 860348477 + instructions: 857936684 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_32_64: total: calls: 1 - instructions: 739516375 + instructions: 737074307 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_32_8: total: calls: 1 - instructions: 698420032 + instructions: 696057915 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_4_128: total: calls: 1 - instructions: 454283424 + instructions: 452857933 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_512_128: total: calls: 1 - instructions: 4073984952 + instructions: 4071507249 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_64_128: total: calls: 1 - instructions: 912421076 + instructions: 910052271 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_blob_8_128: total: calls: 1 - instructions: 601391159 + instructions: 599299651 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_principal: total: calls: 1 - instructions: 686637993 + instructions: 684159422 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_u64_blob8: total: calls: 1 - instructions: 567961678 + instructions: 566079913 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_u64_u64: total: calls: 1 - instructions: 588636203 + instructions: 586718731 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_u64_vec8: total: calls: 1 - instructions: 573239240 + instructions: 571366355 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec8_u64: total: calls: 1 - instructions: 757940298 + instructions: 755823918 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_1024_128: total: calls: 1 - instructions: 4479172212 + instructions: 4475943466 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_128_128: total: calls: 1 - instructions: 1420780368 + instructions: 1418213214 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_16_128: total: calls: 1 - instructions: 923559881 + instructions: 921111290 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_256_128: total: calls: 1 - instructions: 2247091590 + instructions: 2244668594 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_32_0: total: calls: 1 - instructions: 836727519 + instructions: 834330028 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_32_1024: total: calls: 1 - instructions: 1704981005 + instructions: 1701563272 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_32_128: total: calls: 1 - instructions: 1039536032 + instructions: 1036968514 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_32_16: total: calls: 1 - instructions: 873694842 + instructions: 871328883 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_32_256: total: calls: 1 - instructions: 1242839449 + instructions: 1240176546 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_32_32: total: calls: 1 - instructions: 869946380 + instructions: 867569469 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_32_4: total: calls: 1 - instructions: 864553339 + instructions: 862147420 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_32_512: total: calls: 1 - instructions: 1408773115 + instructions: 1405971132 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_32_64: total: calls: 1 - instructions: 970794427 + instructions: 968312981 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_32_8: total: calls: 1 - instructions: 858857082 + instructions: 856477157 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_4_128: total: calls: 1 - instructions: 663721379 + instructions: 662121914 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_512_128: total: calls: 1 - instructions: 3085357276 + instructions: 3082706271 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_64_128: total: calls: 1 - instructions: 1186524634 + instructions: 1183958569 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_remove_vec_8_128: total: calls: 1 - instructions: 823969137 + instructions: 821774415 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_iter_1k_0b: total: calls: 1 - instructions: 983218 + instructions: 975992 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_iter_1k_10kib: total: calls: 1 - instructions: 2532766 + instructions: 2491763 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_iter_20_10mib: total: calls: 1 - instructions: 19088588 + instructions: 18467176 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_iter_rev_1k_0b: total: calls: 1 - instructions: 981392 + instructions: 978166 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_iter_rev_1k_10kib: total: calls: 1 - instructions: 2512600 + instructions: 2475597 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_iter_rev_20_10mib: total: calls: 1 - instructions: 19088500 + instructions: 18467168 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_keys_1k_0b: total: calls: 1 - instructions: 981074 + instructions: 982657 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_keys_1k_10kib: total: calls: 1 - instructions: 2530622 + instructions: 2498428 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_keys_20_10mib: total: calls: 1 - instructions: 19088554 + instructions: 18467320 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_keys_rev_1k_0b: total: calls: 1 - instructions: 982640 + instructions: 984223 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_keys_rev_1k_10kib: total: calls: 1 - instructions: 2513848 + instructions: 2481654 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_keys_rev_20_10mib: total: calls: 1 - instructions: 19088532 + instructions: 18467298 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_values_1k_0b: total: calls: 1 - instructions: 1236218 + instructions: 1230992 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_values_1k_10kib: total: calls: 1 - instructions: 56779282 + instructions: 56740279 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_values_20_10mib: total: calls: 1 - instructions: 1104332266 + instructions: 1103710894 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_values_rev_1k_0b: total: calls: 1 - instructions: 1232724 + instructions: 1231498 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_values_rev_1k_10kib: total: calls: 1 - instructions: 56718110 + instructions: 56683107 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_values_rev_20_10mib: total: calls: 1 - instructions: 1104331697 + instructions: 1103710405 heap_increase: 0 stable_memory_increase: 0 scopes: {} diff --git a/benchmarks/nns/canbench_results.yml b/benchmarks/nns/canbench_results.yml index 4186b23d..eaae0dba 100644 --- a/benchmarks/nns/canbench_results.yml +++ b/benchmarks/nns/canbench_results.yml @@ -58,56 +58,56 @@ benches: vote_cascading_stable_centralized_10k: total: calls: 1 - instructions: 1375501036 + instructions: 1372961069 heap_increase: 10 stable_memory_increase: 0 scopes: {} vote_cascading_stable_centralized_1k: total: calls: 1 - instructions: 99996435 + instructions: 99785557 heap_increase: 1 stable_memory_increase: 0 scopes: {} vote_cascading_stable_chain_10k_15: total: calls: 1 - instructions: 9819218496 + instructions: 9812239095 heap_increase: 5 stable_memory_increase: 0 scopes: {} vote_cascading_stable_chain_10k_5: total: calls: 1 - instructions: 3007431336 + instructions: 3002837502 heap_increase: 5 stable_memory_increase: 0 scopes: {} vote_cascading_stable_chain_1k_15: total: calls: 1 - instructions: 867330736 + instructions: 866689025 heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_chain_1k_5: total: calls: 1 - instructions: 253041123 + instructions: 252669627 heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_single_vote_10k: total: calls: 1 - instructions: 91466 + instructions: 91222 heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_single_vote_1k: total: calls: 1 - instructions: 66840 + instructions: 66644 heap_increase: 0 stable_memory_increase: 0 scopes: {} From f8541e7274245bb153be33a2209727399683ae7e Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Thu, 17 Jul 2025 07:32:54 +0000 Subject: [PATCH 24/32] --persist on ubuntu --- benchmarks/nns/canbench_results.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/benchmarks/nns/canbench_results.yml b/benchmarks/nns/canbench_results.yml index eaae0dba..4186b23d 100644 --- a/benchmarks/nns/canbench_results.yml +++ b/benchmarks/nns/canbench_results.yml @@ -58,56 +58,56 @@ benches: vote_cascading_stable_centralized_10k: total: calls: 1 - instructions: 1372961069 + instructions: 1375501036 heap_increase: 10 stable_memory_increase: 0 scopes: {} vote_cascading_stable_centralized_1k: total: calls: 1 - instructions: 99785557 + instructions: 99996435 heap_increase: 1 stable_memory_increase: 0 scopes: {} vote_cascading_stable_chain_10k_15: total: calls: 1 - instructions: 9812239095 + instructions: 9819218496 heap_increase: 5 stable_memory_increase: 0 scopes: {} vote_cascading_stable_chain_10k_5: total: calls: 1 - instructions: 3002837502 + instructions: 3007431336 heap_increase: 5 stable_memory_increase: 0 scopes: {} vote_cascading_stable_chain_1k_15: total: calls: 1 - instructions: 866689025 + instructions: 867330736 heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_chain_1k_5: total: calls: 1 - instructions: 252669627 + instructions: 253041123 heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_single_vote_10k: total: calls: 1 - instructions: 91222 + instructions: 91466 heap_increase: 0 stable_memory_increase: 0 scopes: {} vote_cascading_stable_single_vote_1k: total: calls: 1 - instructions: 66644 + instructions: 66840 heap_increase: 0 stable_memory_increase: 0 scopes: {} From 985de01981f9fc098a762e0ffb3fc15b7ea0d9cb Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Thu, 17 Jul 2025 09:46:25 +0200 Subject: [PATCH 25/32] add doc comments --- src/btreemap/iter.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/btreemap/iter.rs b/src/btreemap/iter.rs index 8082b1cb..4d9e6e22 100644 --- a/src/btreemap/iter.rs +++ b/src/btreemap/iter.rs @@ -447,6 +447,10 @@ where } } +/// A lazily evaluated key-value entry from a `BTreeMap` iterator. +/// +/// This struct defers deserialization and cloning of the key and value +/// until they are explicitly accessed, improving performance. pub struct LazyEntry<'a, K, V, M> where K: Storable + Ord + Clone, @@ -464,15 +468,18 @@ where V: Storable, M: Memory, { + /// Returns a reference to the key. pub fn key(&self) -> &K { self.node.key(self.entry_idx, self.map.memory()) } + /// Returns the value by deserializing it. pub fn value(&self) -> V { let encoded_value = self.node.value(self.entry_idx, self.map.memory()); V::from_bytes(Cow::Borrowed(encoded_value)) } + /// Converts the entry into an owned (K, V) pair. pub fn into_pair(self) -> (K, V) { (self.key().clone(), self.value()) } From b7429f87538e9e7f04ca68eba9fd39887cebfaab Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Thu, 17 Jul 2025 10:07:46 +0200 Subject: [PATCH 26/32] api_conformance --- tests/api_conformance.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/api_conformance.rs b/tests/api_conformance.rs index 6cf9c5b3..3f81394c 100644 --- a/tests/api_conformance.rs +++ b/tests/api_conformance.rs @@ -57,7 +57,10 @@ fn api_conformance_btreemap() { // Iterators. // Note: stable.iter() yields (K, V), std.iter() yields (&K, &V) - let stable_items: std::vec::Vec<_> = stable.iter().map(|entry| entry.into_pair()).collect(); + let stable_items: std::vec::Vec<_> = stable + .iter() + .map(|entry| (*entry.key(), entry.value())) + .collect(); let std_items: std::vec::Vec<_> = std.iter().map(|(k, v)| (*k, v.clone())).collect(); assert_eq!(stable_items, std_items); @@ -95,7 +98,7 @@ fn api_conformance_btreemap() { let stable_range: std::vec::Vec<_> = stable .range(range_start..range_end) - .map(|entry| entry.into_pair()) + .map(|entry| (*entry.key(), entry.value())) .collect(); let std_range: std::vec::Vec<_> = std .range(range_start..range_end) @@ -128,7 +131,7 @@ fn api_conformance_btreemap() { let bound = 5; let stable_result: std::vec::Vec<_> = stable .iter_from_prev_key(&bound) - .map(|entry| entry.into_pair()) + .map(|entry| (*entry.key(), entry.value())) .collect(); let std_result: std::vec::Vec<_> = if let Some((start, _)) = std.range(..bound).next_back() { std.range(start..).map(|(k, v)| (*k, v.clone())).collect() From a924b67207a956d14b03b98adc21e1c4cff3da48 Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Thu, 17 Jul 2025 20:23:17 +0200 Subject: [PATCH 27/32] . --- src/btreemap.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/btreemap.rs b/src/btreemap.rs index 42a6bfb0..e82266d1 100644 --- a/src/btreemap.rs +++ b/src/btreemap.rs @@ -1371,6 +1371,7 @@ mod test { it.collect() } + /// A helper function to collect lazy entries into a `Vec`. fn collect_e<'a, K, V, M>(it: impl Iterator>) -> Vec<(K, V)> where K: Storable + Ord + Clone + 'a, From 7350ff14f21565bfbd4bda105a167a1a0a87f6f7 Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Thu, 17 Jul 2025 20:33:57 +0200 Subject: [PATCH 28/32] collect_entry --- src/btreemap.rs | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/btreemap.rs b/src/btreemap.rs index e82266d1..19ad8780 100644 --- a/src/btreemap.rs +++ b/src/btreemap.rs @@ -1372,7 +1372,7 @@ mod test { } /// A helper function to collect lazy entries into a `Vec`. - fn collect_e<'a, K, V, M>(it: impl Iterator>) -> Vec<(K, V)> + fn collect_entry<'a, K, V, M>(it: impl Iterator>) -> Vec<(K, V)> where K: Storable + Ord + Clone + 'a, V: Storable + 'a, @@ -2440,9 +2440,9 @@ mod test { let key = K::build; run_btree_test(|btree: BTreeMap| { // Test prefixes that don't exist in the map. - assert_eq!(collect_e(btree.range(key(0)..)), vec![]); - assert_eq!(collect_e(btree.range(key(10)..)), vec![]); - assert_eq!(collect_e(btree.range(key(100)..)), vec![]); + assert_eq!(collect_entry(btree.range(key(0)..)), vec![]); + assert_eq!(collect_entry(btree.range(key(10)..)), vec![]); + assert_eq!(collect_entry(btree.range(key(100)..)), vec![]); }); } btree_test!(test_range_empty, range_empty); @@ -2454,7 +2454,7 @@ mod test { btree.insert(key(0), value(0)); // Test a prefix that's larger than the value in the leaf node. Should be empty. - assert_eq!(collect_e(btree.range(key(1)..)), vec![]); + assert_eq!(collect_entry(btree.range(key(1)..)), vec![]); }); } btree_test!( @@ -2477,7 +2477,7 @@ mod test { // Test a prefix that's larger than the key in the internal node. assert_eq!( - collect_e(btree.range(key(7)..key(8))), + collect_entry(btree.range(key(7)..key(8))), vec![(key(7), value(7))] ); }); @@ -2518,7 +2518,7 @@ mod test { // Tests a prefix that's smaller than the key in the internal node. assert_eq!( - collect_e(btree.range(key(0)..key(11))), + collect_entry(btree.range(key(0)..key(11))), vec![ (key(1), value(100)), (key(2), value(200)), @@ -2529,7 +2529,7 @@ mod test { // Tests a prefix that crosses several nodes. assert_eq!( - collect_e(btree.range(key(10)..key(20))), + collect_entry(btree.range(key(10)..key(20))), vec![ (key(11), value(500)), (key(12), value(600)), @@ -2540,7 +2540,7 @@ mod test { // Tests a prefix that's larger than the key in the internal node. assert_eq!( - collect_e(btree.range(key(20)..key(30))), + collect_entry(btree.range(key(20)..key(30))), vec![ (key(21), value(900)), (key(22), value(1_000)), @@ -2630,11 +2630,11 @@ mod test { ); // Tests a prefix that doesn't exist, but is in the middle of the root node. - assert_eq!(collect_e(btree.range(key(15)..key(16))), vec![]); + assert_eq!(collect_entry(btree.range(key(15)..key(16))), vec![]); // Tests a prefix beginning in the middle of the tree and crossing several nodes. assert_eq!( - collect_e(btree.range(key(15)..=key(26))), + collect_entry(btree.range(key(15)..=key(26))), vec![ (key(16), value(700)), (key(18), value(800)), @@ -2650,7 +2650,7 @@ mod test { // Tests a prefix that crosses several nodes. assert_eq!( - collect_e(btree.range(key(10)..key(20))), + collect_entry(btree.range(key(10)..key(20))), vec![ (key(12), value(500)), (key(14), value(600)), @@ -2663,7 +2663,7 @@ mod test { // Tests a prefix that starts from a leaf node, then iterates through the root and right // sibling. assert_eq!( - collect_e(btree.range(key(20)..key(30))), + collect_entry(btree.range(key(20)..key(30))), vec![ (key(21), value(1000)), (key(22), value(1100)), @@ -2741,7 +2741,7 @@ mod test { assert_eq!(root.children_len(), 2); assert_eq!( - collect_e(btree.range(key(0)..key(10))), + collect_entry(btree.range(key(0)..key(10))), vec![ (key(1), value(100)), (key(2), value(200)), @@ -2752,12 +2752,12 @@ mod test { // Tests an offset that has a keys somewhere in the range of keys of an internal node. assert_eq!( - collect_e(btree.range(key(13)..key(20))), + collect_entry(btree.range(key(13)..key(20))), vec![(key(13), value(700)), (key(14), value(800))] ); // Tests an offset that's larger than the key in the internal node. - assert_eq!(collect_e(btree.range(key(25)..)), vec![]); + assert_eq!(collect_entry(btree.range(key(25)..)), vec![]); }); } btree_test!( @@ -2842,7 +2842,7 @@ mod test { // Tests a offset that crosses several nodes. assert_eq!( - collect_e(btree.range(key(14)..key(20))), + collect_entry(btree.range(key(14)..key(20))), vec![ (key(14), value(0)), (key(16), value(0)), @@ -2854,7 +2854,7 @@ mod test { // Tests a offset that starts from a leaf node, then iterates through the root and right // sibling. assert_eq!( - collect_e(btree.range(key(22)..key(30))), + collect_entry(btree.range(key(22)..key(30))), vec![ (key(22), value(0)), (key(23), value(0)), @@ -2951,23 +2951,23 @@ mod test { assert_eq!( collect_kv(std_map.range(..)), - collect_e(stable_map.range(..)) + collect_entry(stable_map.range(..)) ); for l in 0..=NKEYS { assert_eq!( collect_kv(std_map.range(key(l)..)), - collect_e(stable_map.range(key(l)..)) + collect_entry(stable_map.range(key(l)..)) ); assert_eq!( collect_kv(std_map.range(..key(l))), - collect_e(stable_map.range(..key(l))) + collect_entry(stable_map.range(..key(l))) ); assert_eq!( collect_kv(std_map.range(..=key(l))), - collect_e(stable_map.range(..=key(l))) + collect_entry(stable_map.range(..=key(l))) ); for r in l + 1..=NKEYS { @@ -2976,7 +2976,7 @@ mod test { let range = (lbound.clone(), rbound); assert_eq!( collect_kv(std_map.range(range.clone())), - collect_e(stable_map.range(range.clone())), + collect_entry(stable_map.range(range.clone())), "range: {range:?}" ); } From c27e87bfd8c4453248999a735502250161c8b4c1 Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Thu, 17 Jul 2025 20:34:15 +0200 Subject: [PATCH 29/32] no &rc --- src/btreemap/iter.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/btreemap/iter.rs b/src/btreemap/iter.rs index 4d9e6e22..a2c2b953 100644 --- a/src/btreemap/iter.rs +++ b/src/btreemap/iter.rs @@ -276,7 +276,7 @@ where // Iterates to find the next element in the requested range. // If it exists, `map` is applied to that element and the result is returned. - fn next_map>, usize) -> T>(&mut self, map: F) -> Option { + fn next_map>, usize) -> T>(&mut self, map: F) -> Option { if !self.forward_cursors_initialized { self.initialize_forward_cursors(); } @@ -333,7 +333,7 @@ where return None; } - let res = map(&node, entry_idx); + let res = map(node.clone(), entry_idx); self.range.0 = Bound::Excluded(node.key(entry_idx, self.map.memory()).clone()); let next = match node.node_type() { @@ -356,7 +356,7 @@ where // Iterates to find the next back element in the requested range. // If it exists, `map` is applied to that element and the result is returned. - fn next_back_map>, usize) -> T>(&mut self, map: F) -> Option { + fn next_back_map>, usize) -> T>(&mut self, map: F) -> Option { if !self.backward_cursors_initialized { self.initialize_backward_cursors(); } @@ -419,7 +419,7 @@ where return None; } - let res = map(&node, entry_idx); + let res = map(node.clone(), entry_idx); self.range.1 = Bound::Excluded(node.key(entry_idx, self.map.memory()).clone()); if let Some(next) = match node.node_type() { @@ -501,7 +501,7 @@ where fn next(&mut self) -> Option { self.0.next_map(|node, entry_idx| LazyEntry { - node: node.clone(), + node, entry_idx, map: self.0.map, }) @@ -523,7 +523,7 @@ where { fn next_back(&mut self) -> Option { self.0.next_back_map(|node, entry_idx| LazyEntry { - node: node.clone(), + node, entry_idx, map: self.0.map, }) From 50cc49981d4f6c4f3d0a1fc13beaf462c819d319 Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Thu, 17 Jul 2025 18:38:05 +0000 Subject: [PATCH 30/32] --persist ubuntu --- benchmarks/btreemap/canbench_results.yml | 30 ++++++++++++------------ 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/benchmarks/btreemap/canbench_results.yml b/benchmarks/btreemap/canbench_results.yml index 2dabed3e..8910ae62 100644 --- a/benchmarks/btreemap/canbench_results.yml +++ b/benchmarks/btreemap/canbench_results.yml @@ -1633,21 +1633,21 @@ benches: btreemap_v2_range_count_1k_0b: total: calls: 1 - instructions: 16962 + instructions: 16977 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_range_count_1k_10kib: total: calls: 1 - instructions: 2507196 + instructions: 2522196 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_range_count_20_10mib: total: calls: 1 - instructions: 18468765 + instructions: 18469065 heap_increase: 0 stable_memory_increase: 0 scopes: {} @@ -2039,84 +2039,84 @@ benches: btreemap_v2_scan_keys_1k_0b: total: calls: 1 - instructions: 982657 + instructions: 998261 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_keys_1k_10kib: total: calls: 1 - instructions: 2498428 + instructions: 2514032 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_keys_20_10mib: total: calls: 1 - instructions: 18467320 + instructions: 18467632 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_keys_rev_1k_0b: total: calls: 1 - instructions: 984223 + instructions: 1000223 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_keys_rev_1k_10kib: total: calls: 1 - instructions: 2481654 + instructions: 2497654 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_keys_rev_20_10mib: total: calls: 1 - instructions: 18467298 + instructions: 18467618 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_values_1k_0b: total: calls: 1 - instructions: 1230992 + instructions: 1254596 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_values_1k_10kib: total: calls: 1 - instructions: 56740279 + instructions: 56763883 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_values_20_10mib: total: calls: 1 - instructions: 1103710894 + instructions: 1103711366 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_values_rev_1k_0b: total: calls: 1 - instructions: 1231498 + instructions: 1255498 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_values_rev_1k_10kib: total: calls: 1 - instructions: 56683107 + instructions: 56707107 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_values_rev_20_10mib: total: calls: 1 - instructions: 1103710405 + instructions: 1103710885 heap_increase: 0 stable_memory_increase: 0 scopes: {} From bcf0e8633701d6c44fd235705c78a916ca6f140e Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Thu, 17 Jul 2025 20:52:31 +0200 Subject: [PATCH 31/32] Revert "--persist ubuntu" This reverts commit 50cc49981d4f6c4f3d0a1fc13beaf462c819d319. --- benchmarks/btreemap/canbench_results.yml | 30 ++++++++++++------------ 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/benchmarks/btreemap/canbench_results.yml b/benchmarks/btreemap/canbench_results.yml index 8910ae62..2dabed3e 100644 --- a/benchmarks/btreemap/canbench_results.yml +++ b/benchmarks/btreemap/canbench_results.yml @@ -1633,21 +1633,21 @@ benches: btreemap_v2_range_count_1k_0b: total: calls: 1 - instructions: 16977 + instructions: 16962 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_range_count_1k_10kib: total: calls: 1 - instructions: 2522196 + instructions: 2507196 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_range_count_20_10mib: total: calls: 1 - instructions: 18469065 + instructions: 18468765 heap_increase: 0 stable_memory_increase: 0 scopes: {} @@ -2039,84 +2039,84 @@ benches: btreemap_v2_scan_keys_1k_0b: total: calls: 1 - instructions: 998261 + instructions: 982657 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_keys_1k_10kib: total: calls: 1 - instructions: 2514032 + instructions: 2498428 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_keys_20_10mib: total: calls: 1 - instructions: 18467632 + instructions: 18467320 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_keys_rev_1k_0b: total: calls: 1 - instructions: 1000223 + instructions: 984223 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_keys_rev_1k_10kib: total: calls: 1 - instructions: 2497654 + instructions: 2481654 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_keys_rev_20_10mib: total: calls: 1 - instructions: 18467618 + instructions: 18467298 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_values_1k_0b: total: calls: 1 - instructions: 1254596 + instructions: 1230992 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_values_1k_10kib: total: calls: 1 - instructions: 56763883 + instructions: 56740279 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_values_20_10mib: total: calls: 1 - instructions: 1103711366 + instructions: 1103710894 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_values_rev_1k_0b: total: calls: 1 - instructions: 1255498 + instructions: 1231498 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_values_rev_1k_10kib: total: calls: 1 - instructions: 56707107 + instructions: 56683107 heap_increase: 0 stable_memory_increase: 0 scopes: {} btreemap_v2_scan_values_rev_20_10mib: total: calls: 1 - instructions: 1103710885 + instructions: 1103710405 heap_increase: 0 stable_memory_increase: 0 scopes: {} From 95d9ae7a2c45b6b440459e2a939918e798090a07 Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Thu, 17 Jul 2025 20:54:26 +0200 Subject: [PATCH 32/32] Revert "no &rc" This reverts commit c27e87bfd8c4453248999a735502250161c8b4c1. --- src/btreemap/iter.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/btreemap/iter.rs b/src/btreemap/iter.rs index a2c2b953..4d9e6e22 100644 --- a/src/btreemap/iter.rs +++ b/src/btreemap/iter.rs @@ -276,7 +276,7 @@ where // Iterates to find the next element in the requested range. // If it exists, `map` is applied to that element and the result is returned. - fn next_map>, usize) -> T>(&mut self, map: F) -> Option { + fn next_map>, usize) -> T>(&mut self, map: F) -> Option { if !self.forward_cursors_initialized { self.initialize_forward_cursors(); } @@ -333,7 +333,7 @@ where return None; } - let res = map(node.clone(), entry_idx); + let res = map(&node, entry_idx); self.range.0 = Bound::Excluded(node.key(entry_idx, self.map.memory()).clone()); let next = match node.node_type() { @@ -356,7 +356,7 @@ where // Iterates to find the next back element in the requested range. // If it exists, `map` is applied to that element and the result is returned. - fn next_back_map>, usize) -> T>(&mut self, map: F) -> Option { + fn next_back_map>, usize) -> T>(&mut self, map: F) -> Option { if !self.backward_cursors_initialized { self.initialize_backward_cursors(); } @@ -419,7 +419,7 @@ where return None; } - let res = map(node.clone(), entry_idx); + let res = map(&node, entry_idx); self.range.1 = Bound::Excluded(node.key(entry_idx, self.map.memory()).clone()); if let Some(next) = match node.node_type() { @@ -501,7 +501,7 @@ where fn next(&mut self) -> Option { self.0.next_map(|node, entry_idx| LazyEntry { - node, + node: node.clone(), entry_idx, map: self.0.map, }) @@ -523,7 +523,7 @@ where { fn next_back(&mut self) -> Option { self.0.next_back_map(|node, entry_idx| LazyEntry { - node, + node: node.clone(), entry_idx, map: self.0.map, })