fn do_bench_insert_bucket_map(bencher: &mut Bencher, n: usize, m: usize) {
    let index = BucketMap::new(BucketMapConfig::new(n));
    (0..n).into_iter().into_par_iter().for_each(|i| {
        let key = Pubkey::new_unique();
        index.update(&key, |_| Some((vec![(i, IndexValue::default())], 0)));
    });
    bencher.iter(|| {
        (0..n).into_iter().into_par_iter().for_each(|_| {
            for j in 0..m {
                let key = Pubkey::new_unique();
                index.update(&key, |_| Some((vec![(j, IndexValue::default())], 0)));
            }
        })
    });
}
/// Benchmark insert with BucketMap with N buckets for N threads inserting M keys each
Benchmark insert with BucketMap with N buckets for N threads inserting M keys each
Benchmark insert with BucketMap with N buckets for N threads inserting M keys each
fn do_bench_insert_bucket_map(bencher: &mut Bencher, n: usize, m: usize) {
    let index = BucketMap::new(BucketMapConfig::new(n));
    (0..n).into_iter().into_par_iter().for_each(|i| {
        let key = Pubkey::new_unique();
        index.update(&key, |_| Some((vec![(i, IndexValue::default())], 0)));
    });
    bencher.iter(|| {
        (0..n).into_iter().into_par_iter().for_each(|_| {
            for j in 0..m {
                let key = Pubkey::new_unique();
                index.update(&key, |_| Some((vec![(j, IndexValue::default())], 0)));
            }
        })
    });
}
fn do_bench_insert_bucket_map ( bencher : & mut Bencher , n : usize , m : usize ) { let index = BucketMap :: new ( BucketMapConfig :: new ( n ) ) ; ( 0 .. n ) . into_iter ( ) . into_par_iter ( ) . for_each ( | i | { let key = Pubkey :: new_unique ( ) ; index . update ( & key , | _ | Some ( ( vec ! [ ( i IndexValue default ( ) ) ] , 0 ) ) ) ; } ) ; bencher . iter ( | | { ( 0 .. n ) . into_iter ( ) . into_par_iter ( ) . for_each ( | _ | { for j in 0 .. m { let key = Pubkey :: new_unique ( ) ; index . update ( & key , | _ | Some ( ( vec ! [ ( j IndexValue default ( ) ) ] , 0 ) ) ) ; } } ) } ) ; }
Benchmark insert with BucketMap with N buckets for N threads inserting M keys each
Benchmark insert with BucketMap with N buckets for N threads inserting M keys each
bencher
&mut Bencher
n
usize
m
usize