提交 2dd22e54 编写于 作者: S Siying Dong 提交者: Facebook Github Bot

Make DBIter class final

Summary:
DBIter is referenced in ArenaWrappedDBIter, which is a simple wrapper. If DBIter is final, some virtual function call can be avoided. Some functions can even be inlined, like DBIter.value() to ArenaWrappedDBIter.value() and DBIter.key() to ArenaWrappedDBIter.key(). The performance gain is hard to measure. I just ran the memory-only benchmark for readseq and saw it didn't regress. There shouldn't be any harm doing it. Just give compiler more choices.
Closes https://github.com/facebook/rocksdb/pull/2859

Differential Revision: D5799888

Pulled By: siying

fbshipit-source-id: 829788f91310c40282dcfb7e412e6ef489931143
上级 2a591504
...@@ -50,7 +50,7 @@ static void DumpInternalIter(Iterator* iter) { ...@@ -50,7 +50,7 @@ static void DumpInternalIter(Iterator* iter) {
// combines multiple entries for the same userkey found in the DB // combines multiple entries for the same userkey found in the DB
// representation into a single entry while accounting for sequence // representation into a single entry while accounting for sequence
// numbers, deletion markers, overwrites, etc. // numbers, deletion markers, overwrites, etc.
class DBIter: public Iterator { class DBIter final: public Iterator {
public: public:
// The following is grossly complicated. TODO: clean it up // The following is grossly complicated. TODO: clean it up
// Which direction is the iterator currently moving? // Which direction is the iterator currently moving?
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册