Skip to content

Commit

Permalink
Add noinline attribute for logging member functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
toregge committed Nov 26, 2024
1 parent 1759715 commit 9545567
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions searchlib/src/vespa/searchlib/diskindex/disktermblueprint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ DiskTermBlueprint::fetchPostings(const queryeval::ExecuteInfo &execInfo)
(void) execInfo;
if (!_fetchPostingsDone) {
if (_useBitVector && _bitvector_lookup_result.valid()) {
if (LOG_WOULD_LOG(debug)) {
if (LOG_WOULD_LOG(debug)) [[unlikely]] {
log_bitvector_read();
}
_bitVector = _field_index.read_bit_vector(_bitvector_lookup_result);
}
if (!_bitVector) {
if (LOG_WOULD_LOG(debug)) {
if (LOG_WOULD_LOG(debug)) [[unlikely]] {
log_posting_list_read();
}
_postingHandle = _field_index.read_posting_list(_lookupRes);
Expand All @@ -121,7 +121,7 @@ DiskTermBlueprint::get_bitvector() const
}
std::lock_guard guard(_mutex);
if (!_late_bitvector) {
if (LOG_WOULD_LOG(debug)) {
if (LOG_WOULD_LOG(debug)) [[unlikely]] {
log_bitvector_read();
}
_late_bitvector = _field_index.read_bit_vector(_bitvector_lookup_result);
Expand Down
4 changes: 2 additions & 2 deletions searchlib/src/vespa/searchlib/diskindex/disktermblueprint.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class DiskTermBlueprint : public queryeval::SimpleLeafBlueprint
mutable std::shared_ptr<BitVector> _late_bitvector;

const BitVector* get_bitvector() const;
void log_bitvector_read() const;
void log_posting_list_read() const;
void log_bitvector_read() const __attribute__((noinline));
void log_posting_list_read() const __attribute__((noinline));
public:
/**
* Create a new blueprint.
Expand Down

0 comments on commit 9545567

Please sign in to comment.