File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 3333// readmissing -- read N missing keys in random order
3434// readhot -- read N times in random order from 1% section of DB
3535// seekrandom -- N random seeks
36+ // open -- cost of opening a DB
3637// crc32c -- repeated crc32c of 4K of data
3738// acquireload -- load N*1000 times
3839// Meta operations:
@@ -442,7 +443,11 @@ class Benchmark {
442443 bool fresh_db = false ;
443444 int num_threads = FLAGS_threads;
444445
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" )) {
446451 fresh_db = true ;
447452 method = &Benchmark::WriteSeq;
448453 } else if (name == Slice (" fillbatch" )) {
@@ -702,6 +707,14 @@ class Benchmark {
702707 }
703708 }
704709
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+
705718 void WriteSeq (ThreadState* thread) {
706719 DoWrite (thread, true );
707720 }
You can’t perform that action at this time.
0 commit comments