We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 999d165 commit 0faf404Copy full SHA for 0faf404
src/key.rs
@@ -2204,3 +2204,24 @@ mod test {
2204
assert_eq!(got, want)
2205
}
2206
2207
+
2208
+#[cfg(all(test, feature = "unstable"))]
2209
+mod benches {
2210
+ use test::Bencher;
2211
+ use std::collections::BTreeSet;
2212
+ use crate::PublicKey;
2213
+ use crate::constants::GENERATOR_X;
2214
2215
+ #[bench]
2216
+ fn bench_pk_ordering(b: &mut Bencher) {
2217
+ let mut map = BTreeSet::new();
2218
+ let mut g_slice = [02u8; 33];
2219
+ g_slice[1..].copy_from_slice(&GENERATOR_X);
2220
+ let g = PublicKey::from_slice(&g_slice).unwrap();
2221
+ let mut pk = g;
2222
+ b.iter(|| {
2223
+ map.insert(pk);
2224
+ pk = pk.combine(&pk).unwrap();
2225
+ })
2226
+ }
2227
+}
0 commit comments