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

	dbi := openBenchDBI(b, env)

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

	err = env.View(func(txn *Txn) (err error) {
		txn.RawRead = true
		b.ResetTimer()
		defer b.StopTimer()
		for i := 0; i < b.N; i++ {
			_, err := txn.Get(dbi, ps[rand.Intn(len(ps))])
			if IsNotFound(err) {
				continue
			}
			if err != nil {
				b.Fatalf("error getting data: %v", err)
			}
		}
		return nil
	})
	if err != nil {
		b.Error(err)
		return
	}
}
// like BenchmarkTxnGetReadonly but txn.RawRead is set to true.
like BenchmarkTxnGetReadonly but txn.RawRead is set to true.
// like BenchmarkTxnGetReadonly but txn . RawRead is set to true .
func BenchmarkTxn_Get_raw_ro(b *testing.B) {
	initRandSource(b)
	env := setup(b)
	defer clean(env, b)
	dbi := openBenchDBI(b, env)
	rc := newRandSourceCursor()
	ps, err := populateBenchmarkDB(env, dbi, &rc)
	if err != nil {
		b.Errorf("populate db: %v", err)
		return
	}
	err = env.View(func(txn *Txn) (err error) {
		txn.RawRead = true
		b.ResetTimer()
		defer b.StopTimer()
		for i := 0; i < b.N; i++ {
			_, err := txn.Get(dbi, ps[rand.Intn(len(ps))])
			if IsNotFound(err) {
				continue
			}
			if err != nil {
				b.Fatalf("error getting data: %v", err)
			}
		}
		return nil
	})
	if err != nil {
		b.Error(err)
		return
	}
}
func BenchmarkTxn_Get_raw_ro ( b * testing . B ) { initRandSource ( b ) env := setup ( b ) defer clean ( env , b ) dbi := openBenchDBI ( b , env ) rc := newRandSourceCursor ( ) ps , err := populateBenchmarkDB ( env , dbi , & rc ) if err != nil { b . Errorf ( " " , err ) return } err = env . View ( func ( txn * Txn ) ( err error ) { txn . RawRead = true b . ResetTimer ( ) defer b . StopTimer ( ) for i := 0 ; i < b . N ; i ++ { _ , err := txn . Get ( dbi , ps [ rand . Intn ( len ( ps ) ) ] ) if IsNotFound ( err ) { continue } if err != nil { b . Fatalf ( " " , err ) } } return nil } ) if err != nil { b . Error ( err ) return } }
like BenchmarkTxnGetReadonly but txn.RawRead is set to true.
like BenchmarkTxnGetReadonly but txn . RawRead is set to true .