summaryrefslogtreecommitdiffstats
path: root/searchcore
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 /searchcore
parent6ab2bdc05ee2ad463e656c9ce57d67f14c743e3e (diff)
- Add is_search_multi_threaded to proton::matching::BlueprintBuilder for consistency and readability.
- Fix CreateBlueprintVisitorHelper to actually detect singlethreaded usage.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/blueprintbuilder.cpp8
1 files changed, 6 insertions, 2 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();