[RocksDB Performance Branch] Introduce MergeContext to Lazily Initialize merge operand list

Summary: In get operations, merge_operands is only used in few cases. Lazily initialize it can reduce average latency in some cases

Test Plan: make all check

Reviewers: haobo, kailiu, dhruba

Reviewed By: haobo

CC: igor, nkg-, leveldb

Differential Revision: https://reviews.facebook.net/D14415
This commit is contained in:
Siying Dong
2013-12-02 18:34:05 -08:00
parent 90729f8b23
commit ef2211a9ca
10 changed files with 129 additions and 53 deletions

View File

@@ -38,6 +38,7 @@ class MemTable;
class TableCache;
class Version;
class VersionSet;
class MergeContext;
// Return the smallest index i such that files[i]->largest >= key.
// Return files.size() if there is no such file.
@@ -76,9 +77,9 @@ class Version {
int seek_file_level;
};
void Get(const ReadOptions&, const LookupKey& key, std::string* val,
Status* status, std::deque<std::string>* operands, GetStats* stats,
const Options& db_option,
bool* value_found = nullptr);
Status* status, MergeContext* merge_context,
GetStats* stats, const Options& db_option, bool* value_found =
nullptr);
// Adds "stats" into the current state. Returns true if a new
// compaction may need to be triggered, false otherwise.