func BenchmarkScan_ro(b *testing.B) {
	initRandSource(b)
	env := setup(b)
	defer clean(env, b)

	dbi := openBenchDBI(b, env)

	rc := newRandSourceCursor()
	_, err := populateBenchmarkDB(env, dbi, &rc)
	if err != nil {
		b.Errorf("populate db: %v", err)
		return
	}

	err = env.View(func(txn *Txn) (err error) {
		b.ResetTimer()
		defer b.StopTimer()
		for i := 0; i < b.N; i++ {
			err := benchmarkScanDBI(txn, dbi)
			if err != nil {
				return err
			}
		}

		return nil
	})
	if err != nil {
		b.Error(err)
		return
	}
}
// repeatedly scan all the values in a database.
repeatedly scan all the values in a database.
// repeatedly scan all the values in a database .
func BenchmarkScan_ro(b *testing.B) {
	initRandSource(b)
	env := setup(b)
	defer clean(env, b)
	dbi := openBenchDBI(b, env)
	rc := newRandSourceCursor()
	_, err := populateBenchmarkDB(env, dbi, &rc)
	if err != nil {
		b.Errorf("populate db: %v", err)
		return
	}
	err = env.View(func(txn *Txn) (err error) {
		b.ResetTimer()
		defer b.StopTimer()
		for i := 0; i < b.N; i++ {
			err := benchmarkScanDBI(txn, dbi)
			if err != nil {
				return err
			}
		}
		return nil
	})
	if err != nil {
		b.Error(err)
		return
	}
}
func BenchmarkScan_ro ( b * testing . B ) { initRandSource ( b ) env := setup ( b ) defer clean ( env , b ) dbi := openBenchDBI ( b , env ) rc := newRandSourceCursor ( ) _ , err := populateBenchmarkDB ( env , dbi , & rc ) if err != nil { b . Errorf ( " " , err ) return } err = env . View ( func ( txn * Txn ) ( err error ) { b . ResetTimer ( ) defer b . StopTimer ( ) for i := 0 ; i < b . N ; i ++ { err := benchmarkScanDBI ( txn , dbi ) if err != nil { return err } } return nil } ) if err != nil { b . Error ( err ) return } }
repeatedly scan all the values in a database.
repeatedly scan all the values in a database .