Commit 77948e7 1 parent 34ad72e commit 77948e7 Copy full SHA for 77948e7
File tree 1 file changed +14
-1
lines changed
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 33
33
// readmissing -- read N missing keys in random order
34
34
// readhot -- read N times in random order from 1% section of DB
35
35
// seekrandom -- N random seeks
36
+ // open -- cost of opening a DB
36
37
// crc32c -- repeated crc32c of 4K of data
37
38
// acquireload -- load N*1000 times
38
39
// Meta operations:
@@ -442,7 +443,11 @@ class Benchmark {
442
443
bool fresh_db = false ;
443
444
int num_threads = FLAGS_threads;
444
445
445
- if (name == Slice (" fillseq" )) {
446
+ if (name == Slice (" open" )) {
447
+ method = &Benchmark::OpenBench;
448
+ num_ /= 10000 ;
449
+ if (num_ < 1 ) num_ = 1 ;
450
+ } else if (name == Slice (" fillseq" )) {
446
451
fresh_db = true ;
447
452
method = &Benchmark::WriteSeq;
448
453
} else if (name == Slice (" fillbatch" )) {
@@ -702,6 +707,14 @@ class Benchmark {
702
707
}
703
708
}
704
709
710
+ void OpenBench (ThreadState* thread) {
711
+ for (int i = 0 ; i < num_; i++) {
712
+ delete db_;
713
+ Open ();
714
+ thread->stats .FinishedSingleOp ();
715
+ }
716
+ }
717
+
705
718
void WriteSeq (ThreadState* thread) {
706
719
DoWrite (thread, true );
707
720
}
You can’t perform that action at this time.
0 commit comments