@ -1109,9 +1109,8 @@ static void IteratorSeek(benchmark::State& state) {
}
}
}
}
{
std : : unique_ptr < Iterator > iter { nullptr } ;
for ( auto _ : state ) {
for ( auto _ : state ) {
std : : unique_ptr < Iterator > iter { nullptr } ;
state . PauseTiming ( ) ;
state . PauseTiming ( ) ;
if ( ! iter ) {
if ( ! iter ) {
iter . reset ( db - > NewIterator ( ReadOptions ( ) ) ) ;
iter . reset ( db - > NewIterator ( ReadOptions ( ) ) ) ;
@ -1124,7 +1123,6 @@ static void IteratorSeek(benchmark::State& state) {
state . ResumeTiming ( ) ;
state . ResumeTiming ( ) ;
iter - > Seek ( key ) ;
iter - > Seek ( key ) ;
}
}
}
if ( state . thread_index ( ) = = 0 ) {
if ( state . thread_index ( ) = = 0 ) {
TeardownDB ( state , db , options , kg ) ;
TeardownDB ( state , db , options , kg ) ;
@ -1202,9 +1200,8 @@ static void IteratorNext(benchmark::State& state) {
}
}
}
}
{
std : : unique_ptr < Iterator > iter { nullptr } ;
for ( auto _ : state ) {
for ( auto _ : state ) {
std : : unique_ptr < Iterator > iter { nullptr } ;
state . PauseTiming ( ) ;
state . PauseTiming ( ) ;
if ( ! iter ) {
if ( ! iter ) {
iter . reset ( db - > NewIterator ( ReadOptions ( ) ) ) ;
iter . reset ( db - > NewIterator ( ReadOptions ( ) ) ) ;
@ -1218,7 +1215,6 @@ static void IteratorNext(benchmark::State& state) {
state . ResumeTiming ( ) ;
state . ResumeTiming ( ) ;
iter - > Next ( ) ;
iter - > Next ( ) ;
}
}
}
if ( state . thread_index ( ) = = 0 ) {
if ( state . thread_index ( ) = = 0 ) {
TeardownDB ( state , db , options , kg ) ;
TeardownDB ( state , db , options , kg ) ;
@ -1281,9 +1277,8 @@ static void IteratorNextWithPerfContext(benchmark::State& state) {
SetPerfLevel ( kEnableTime ) ;
SetPerfLevel ( kEnableTime ) ;
get_perf_context ( ) - > EnablePerLevelPerfContext ( ) ;
get_perf_context ( ) - > EnablePerLevelPerfContext ( ) ;
{
std : : unique_ptr < Iterator > iter { nullptr } ;
for ( auto _ : state ) {
for ( auto _ : state ) {
std : : unique_ptr < Iterator > iter { nullptr } ;
state . PauseTiming ( ) ;
state . PauseTiming ( ) ;
if ( ! iter ) {
if ( ! iter ) {
iter . reset ( db - > NewIterator ( ReadOptions ( ) ) ) ;
iter . reset ( db - > NewIterator ( ReadOptions ( ) ) ) ;
@ -1298,15 +1293,12 @@ static void IteratorNextWithPerfContext(benchmark::State& state) {
state . ResumeTiming ( ) ;
state . ResumeTiming ( ) ;
iter - > Next ( ) ;
iter - > Next ( ) ;
user_key_comparison_count + =
user_key_comparison_count + = get_perf_context ( ) - > user_key_comparison_count ;
get_perf_context ( ) - > user_key_comparison_count ;
internal_key_skipped_count + =
internal_key_skipped_count + =
get_perf_context ( ) - > internal_key_skipped_count ;
get_perf_context ( ) - > internal_key_skipped_count ;
find_next_user_entry_time + =
find_next_user_entry_time + = get_perf_context ( ) - > find_next_user_entry_time ;
get_perf_context ( ) - > find_next_user_entry_time ;
iter_next_cpu_nanos + = get_perf_context ( ) - > iter_next_cpu_nanos ;
iter_next_cpu_nanos + = get_perf_context ( ) - > iter_next_cpu_nanos ;
}
}
}
state . counters [ " user_key_comparison_count " ] =
state . counters [ " user_key_comparison_count " ] =
benchmark : : Counter ( static_cast < double > ( user_key_comparison_count ) ,
benchmark : : Counter ( static_cast < double > ( user_key_comparison_count ) ,
@ -1370,9 +1362,8 @@ static void IteratorPrev(benchmark::State& state) {
}
}
}
}
{
std : : unique_ptr < Iterator > iter { nullptr } ;
for ( auto _ : state ) {
for ( auto _ : state ) {
std : : unique_ptr < Iterator > iter { nullptr } ;
state . PauseTiming ( ) ;
state . PauseTiming ( ) ;
if ( ! iter ) {
if ( ! iter ) {
iter . reset ( db - > NewIterator ( ReadOptions ( ) ) ) ;
iter . reset ( db - > NewIterator ( ReadOptions ( ) ) ) ;
@ -1386,7 +1377,6 @@ static void IteratorPrev(benchmark::State& state) {
state . ResumeTiming ( ) ;
state . ResumeTiming ( ) ;
iter - > Prev ( ) ;
iter - > Prev ( ) ;
}
}
}
if ( state . thread_index ( ) = = 0 ) {
if ( state . thread_index ( ) = = 0 ) {
TeardownDB ( state , db , options , kg ) ;
TeardownDB ( state , db , options , kg ) ;
@ -1464,9 +1454,8 @@ static void PrefixSeek(benchmark::State& state) {
}
}
}
}
{
std : : unique_ptr < Iterator > iter { nullptr } ;
for ( auto _ : state ) {
for ( auto _ : state ) {
std : : unique_ptr < Iterator > iter { nullptr } ;
state . PauseTiming ( ) ;
state . PauseTiming ( ) ;
if ( ! iter ) {
if ( ! iter ) {
iter . reset ( db - > NewIterator ( ReadOptions ( ) ) ) ;
iter . reset ( db - > NewIterator ( ReadOptions ( ) ) ) ;
@ -1478,7 +1467,6 @@ static void PrefixSeek(benchmark::State& state) {
return ;
return ;
}
}
}
}
}
if ( state . thread_index ( ) = = 0 ) {
if ( state . thread_index ( ) = = 0 ) {
TeardownDB ( state , db , options , kg ) ;
TeardownDB ( state , db , options , kg ) ;