Optimize has_duplicates() for short slices
This commit is contained in:
14
benches/runtime.rs
Normal file
14
benches/runtime.rs
Normal file
@@ -0,0 +1,14 @@
|
||||
#![feature(test)]
|
||||
|
||||
extern crate test;
|
||||
|
||||
use solana::runtime::*;
|
||||
use test::Bencher;
|
||||
|
||||
#[bench]
|
||||
fn bench_has_duplicates(bencher: &mut Bencher) {
|
||||
bencher.iter(|| {
|
||||
let data = test::black_box([1, 2, 3]);
|
||||
assert!(!has_duplicates(&data));
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user