diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-11-08 12:41:49 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-08 12:41:49 +0100 |
commit | 0fcd194d57f8f11dd4e7e63e46a300f125bb9ac8 (patch) | |
tree | fe2b6b94bc2d1a462aedaafc39892d3dd023f07d /searchcore/src | |
parent | 996866ef40c42e1d6c26bc5be47eaf099d9f4bfd (diff) | |
parent | 055dc3761ecadad56da2cbdf2ede2d80fef332fc (diff) |
Merge pull request #19911 from vespa-engine/balder/inline-frequently-called-small-methods
Inline frequently called methods
Diffstat (limited to 'searchcore/src')
4 files changed, 13 insertions, 57 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/documentmetastore/lid_allocator.cpp b/searchcore/src/vespa/searchcore/proton/documentmetastore/lid_allocator.cpp index 8a6de305f0e..1ae3fa9a680 100644 --- a/searchcore/src/vespa/searchcore/proton/documentmetastore/lid_allocator.cpp +++ b/searchcore/src/vespa/searchcore/proton/documentmetastore/lid_allocator.cpp @@ -32,7 +32,7 @@ LidAllocator::LidAllocator(uint32_t size, } -LidAllocator::~LidAllocator() {} +LidAllocator::~LidAllocator() = default; LidAllocator::DocId LidAllocator::getFreeLid(DocId lidLimit) @@ -79,18 +79,6 @@ LidAllocator::unregisterLid(DocId lid) } } -size_t -LidAllocator::getUsedLidsSize() const -{ - return _usedLids.byteSize(); -} - -void -LidAllocator::trimHoldLists(generation_t firstUsed) -{ - _holdLids.trimHoldLists(firstUsed, _freeLids); -} - void LidAllocator::moveLidBegin(DocId fromLid, DocId toLid) { @@ -268,10 +256,4 @@ LidAllocator::shrinkLidSpace(DocId committedDocIdLimit) ensureSpace(committedDocIdLimit, committedDocIdLimit); } -uint32_t -LidAllocator::getNumUsedLids() const -{ - return _usedLids.count(); -} - } diff --git a/searchcore/src/vespa/searchcore/proton/documentmetastore/lid_allocator.h b/searchcore/src/vespa/searchcore/proton/documentmetastore/lid_allocator.h index 8c7e9bd0f9c..776f1931dbe 100644 --- a/searchcore/src/vespa/searchcore/proton/documentmetastore/lid_allocator.h +++ b/searchcore/src/vespa/searchcore/proton/documentmetastore/lid_allocator.h @@ -38,8 +38,10 @@ public: void ensureSpace(uint32_t newSize, uint32_t newCapacity); void registerLid(DocId lid) { _usedLids.setBit(lid); } void unregisterLid(DocId lid); - size_t getUsedLidsSize() const; - void trimHoldLists(generation_t firstUsed); + size_t getUsedLidsSize() const { return _usedLids.byteSize(); } + void trimHoldLists(generation_t firstUsed) { + _holdLids.trimHoldLists(firstUsed, _freeLids); + } void moveLidBegin(DocId fromLid, DocId toLid); void moveLidEnd(DocId fromLid, DocId toLid); void holdLid(DocId lid, DocId lidLimit, generation_t currentGeneration); @@ -51,7 +53,7 @@ public: void updateActiveLids(DocId lid, bool active); void clearDocs(DocId lidLow, DocId lidLimit); void shrinkLidSpace(DocId committedDocIdLimit); - uint32_t getNumUsedLids() const; + uint32_t getNumUsedLids() const { return _usedLids.count(); } uint32_t getNumActiveLids() const { return _numActiveLids; } diff --git a/searchcore/src/vespa/searchcore/proton/documentmetastore/lidstatevector.cpp b/searchcore/src/vespa/searchcore/proton/documentmetastore/lidstatevector.cpp index e1b5660f483..6bc90033994 100644 --- a/searchcore/src/vespa/searchcore/proton/documentmetastore/lidstatevector.cpp +++ b/searchcore/src/vespa/searchcore/proton/documentmetastore/lidstatevector.cpp @@ -113,28 +113,6 @@ LidStateVector::clearBit(unsigned int idx) maybeUpdateHighest(); } - -bool -LidStateVector::empty() const -{ - return _count == 0u; -} - - -unsigned int -LidStateVector::getLowest() const -{ - return _lowest; -} - - -unsigned int -LidStateVector::getHighest() const -{ - return _highest; -} - - uint32_t LidStateVector::internalCount() { @@ -142,13 +120,4 @@ LidStateVector::internalCount() return _bv.countTrueBits(); } - -uint32_t -LidStateVector::count() const -{ - // Called by document db executor thread or metrics related threads - return _count; -} - - } // namespace proton diff --git a/searchcore/src/vespa/searchcore/proton/documentmetastore/lidstatevector.h b/searchcore/src/vespa/searchcore/proton/documentmetastore/lidstatevector.h index 13ce5e213f3..20fff60911c 100644 --- a/searchcore/src/vespa/searchcore/proton/documentmetastore/lidstatevector.h +++ b/searchcore/src/vespa/searchcore/proton/documentmetastore/lidstatevector.h @@ -48,15 +48,18 @@ public: unsigned int byteSize() const { return _bv.extraByteSize() + sizeof(LidStateVector); } - bool empty() const; - unsigned int getLowest() const; - unsigned int getHighest() const; + bool empty() const { return _count == 0u; } + unsigned int getLowest() const { return _lowest; } + unsigned int getHighest() const { return _highest; } /** * Get cached number of bits set in vector. Called by read or * write thread. Write thread must updated cached number as needed. */ - uint32_t count() const; + uint32_t count() const { + // Called by document db executor thread or metrics related threads + return _count; + } unsigned int getNextTrueBit(unsigned int idx) const { return _bv.getNextTrueBit(idx); |