summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2024-05-29 09:36:34 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2024-05-29 09:51:01 +0000
commitdfb09fa6c47f05c971a41d30056a12ed4bbc3037 (patch)
treec60bc92e687f1b7fb7a6b47768d896141d1ba307
parent6ab2bdc05ee2ad463e656c9ce57d67f14c743e3e (diff)
- Add is_search_multi_threaded to proton::matching::BlueprintBuilder for consistency and readability.
- Fix CreateBlueprintVisitorHelper to actually detect singlethreaded usage.
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/blueprintbuilder.cpp8
-rw-r--r--searchlib/src/vespa/searchlib/queryeval/create_blueprint_visitor_helper.cpp2
2 files changed, 7 insertions, 3 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/matching/blueprintbuilder.cpp b/searchcore/src/vespa/searchcore/proton/matching/blueprintbuilder.cpp
index d66d5e57dc6..f8b6666afc4 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/blueprintbuilder.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/blueprintbuilder.cpp
@@ -62,13 +62,17 @@ private:
Blueprint::UP _result;
void buildChildren(IntermediateBlueprint &parent, const std::vector<Node *> &children);
+ bool is_search_multi_threaded() const noexcept {
+ return _requestContext.thread_bundle().size() > 1;
+ }
template <typename NodeType>
void buildIntermediate(IntermediateBlueprint *b, NodeType &n) __attribute__((noinline));
void buildWeakAnd(ProtonWeakAnd &n) {
- auto *wand = new WeakAndBlueprint(n.getTargetNumHits(), _requestContext.get_attribute_blueprint_params().weakand_range,
- _requestContext.thread_bundle().size() > 1);
+ auto *wand = new WeakAndBlueprint(n.getTargetNumHits(),
+ _requestContext.get_attribute_blueprint_params().weakand_range,
+ is_search_multi_threaded());
Blueprint::UP result(wand);
for (auto node : n.getChildren()) {
uint32_t weight = getWeightFromNode(*node).percent();
diff --git a/searchlib/src/vespa/searchlib/queryeval/create_blueprint_visitor_helper.cpp b/searchlib/src/vespa/searchlib/queryeval/create_blueprint_visitor_helper.cpp
index afeb58c02dd..c4aea7deae8 100644
--- a/searchlib/src/vespa/searchlib/queryeval/create_blueprint_visitor_helper.cpp
+++ b/searchlib/src/vespa/searchlib/queryeval/create_blueprint_visitor_helper.cpp
@@ -24,7 +24,7 @@ CreateBlueprintVisitorHelper::~CreateBlueprintVisitorHelper() = default;
bool
CreateBlueprintVisitorHelper::is_search_multi_threaded() const noexcept {
- return getRequestContext().thread_bundle().size() > 0;
+ return getRequestContext().thread_bundle().size() > 1;
}
attribute::SearchContextParams