From 9545567b38f13ef867720f7762e91fdebafd5962 Mon Sep 17 00:00:00 2001 From: Tor Egge Date: Tue, 26 Nov 2024 16:58:50 +0100 Subject: [PATCH] Add noinline attribute for logging member functions. --- .../src/vespa/searchlib/diskindex/disktermblueprint.cpp | 6 +++--- searchlib/src/vespa/searchlib/diskindex/disktermblueprint.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/searchlib/src/vespa/searchlib/diskindex/disktermblueprint.cpp b/searchlib/src/vespa/searchlib/diskindex/disktermblueprint.cpp index cd2f9cd848b..d83d48fced4 100644 --- a/searchlib/src/vespa/searchlib/diskindex/disktermblueprint.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/disktermblueprint.cpp @@ -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); @@ -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); diff --git a/searchlib/src/vespa/searchlib/diskindex/disktermblueprint.h b/searchlib/src/vespa/searchlib/diskindex/disktermblueprint.h index 7553156f4be..bffdb54df4c 100644 --- a/searchlib/src/vespa/searchlib/diskindex/disktermblueprint.h +++ b/searchlib/src/vespa/searchlib/diskindex/disktermblueprint.h @@ -26,8 +26,8 @@ class DiskTermBlueprint : public queryeval::SimpleLeafBlueprint mutable std::shared_ptr _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.