fn bench_get_seq_cursor(c: &mut Criterion) {
    let n = 100;
    let (_dir, env) = setup_bench_db(n);
    let txn = env.begin_ro_txn().unwrap();
    let db = txn.open_db(None).unwrap();

    c.bench_function("bench_get_seq_cursor", |b| {
        b.iter(|| {
            let (i, count) = txn
                .cursor(&db)
                .unwrap()
                .iter::<ObjectLength, ObjectLength>()
                .map(Result::unwrap)
                .fold((0, 0), |(i, count), (key, val)| {
                    (i + *key + *val, count + 1)
                });

            black_box(i);
            assert_eq!(count, n);
        })
    });
}
/// Benchmark of cursor sequential read performance.
Benchmark of cursor sequential read performance.
Benchmark of cursor sequential read performance .
fn bench_get_seq_cursor(c: &mut Criterion) {
    let n = 100;
    let (_dir, env) = setup_bench_db(n);
    let txn = env.begin_ro_txn().unwrap();
    let db = txn.open_db(None).unwrap();
    c.bench_function("bench_get_seq_cursor", |b| {
        b.iter(|| {
            let (i, count) = txn
                .cursor(&db)
                .unwrap()
                .iter::<ObjectLength, ObjectLength>()
                .map(Result::unwrap)
                .fold((0, 0), |(i, count), (key, val)| {
                    (i + *key + *val, count + 1)
                });
            black_box(i);
            assert_eq!(count, n);
        })
    });
}
fn bench_get_seq_cursor ( c : & mut Criterion ) { let n = 100 ; let ( _dir , env ) = setup_bench_db ( n ) ; let txn = env . begin_ro_txn ( ) . unwrap ( ) ; let db = txn . open_db ( None ) . unwrap ( ) ; c . bench_function ( " " , | b | { b . iter ( | | { let ( i , count ) = txn . cursor ( & db ) . unwrap ( ) . iter :: < ObjectLength , ObjectLength > ( ) . map ( Result :: unwrap ) . fold ( ( 0 , 0 ) , | ( i , count ) , ( key , val ) | { ( i + * key + * val , count + 1 ) } ) ; black_box ( i ) ; assert_eq ! ( count n ) ; } ) } ) ; }
Benchmark of cursor sequential read performance.
Benchmark of cursor sequential read performance .
c
&mut Criterion