diff options
author | Geir Storli <geirst@vespa.ai> | 2024-05-06 17:03:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-06 17:03:05 +0200 |
commit | fdc01d36af130d7edf38e13f070de94c2e55dc57 (patch) | |
tree | 83563b5568eed59d403d9b4a2390a63da6ffde3a /searchlib/src/tests/queryeval/iterator_benchmark/intermediate_blueprint_factory.h | |
parent | 75c398d5cc5143819b28d449bf24a2a3880304bf (diff) | |
parent | 037a40a212c84818ddad4707351a16f8bcd56152 (diff) |
Merge pull request #31128 from vespa-engine/havardpe/source-selector-iterator-benchmarkv8.340.17
baseline source blender integration in benchmark
Diffstat (limited to 'searchlib/src/tests/queryeval/iterator_benchmark/intermediate_blueprint_factory.h')
-rw-r--r-- | searchlib/src/tests/queryeval/iterator_benchmark/intermediate_blueprint_factory.h | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/searchlib/src/tests/queryeval/iterator_benchmark/intermediate_blueprint_factory.h b/searchlib/src/tests/queryeval/iterator_benchmark/intermediate_blueprint_factory.h index 6f7fe4f9ee7..c791d866612 100644 --- a/searchlib/src/tests/queryeval/iterator_benchmark/intermediate_blueprint_factory.h +++ b/searchlib/src/tests/queryeval/iterator_benchmark/intermediate_blueprint_factory.h @@ -4,6 +4,7 @@ #include "benchmark_blueprint_factory.h" #include <vespa/searchlib/queryeval/intermediate_blueprints.h> +#include <vespa/searchlib/attribute/fixedsourceselector.h> #include <unordered_map> namespace search::queryeval::test { @@ -11,7 +12,6 @@ namespace search::queryeval::test { /** * Factory that creates an IntermediateBlueprint (of the given type) with children created by the given factories. */ -template <typename BlueprintType> class IntermediateBlueprintFactory : public BenchmarkBlueprintFactory { private: vespalib::string _name; @@ -19,7 +19,8 @@ private: std::unordered_map<void*, char> _child_names; char child_name(void* blueprint) const; - +protected: + virtual std::unique_ptr<IntermediateBlueprint> make_self() const = 0; public: IntermediateBlueprintFactory(vespalib::stringref name); ~IntermediateBlueprintFactory(); @@ -30,10 +31,26 @@ public: vespalib::string get_name(Blueprint& blueprint) const override; }; -class AndBlueprintFactory : public IntermediateBlueprintFactory<AndBlueprint> { +class AndBlueprintFactory : public IntermediateBlueprintFactory { +protected: + std::unique_ptr<IntermediateBlueprint> make_self() const override; public: AndBlueprintFactory(); }; -} +class SourceBlenderBlueprintFactory : public IntermediateBlueprintFactory +{ +private: + FixedSourceSelector _selector; +protected: + std::unique_ptr<IntermediateBlueprint> make_self() const override; +public: + SourceBlenderBlueprintFactory(); + void init_selector(auto f, uint32_t limit) { + for (uint32_t i = 0; i < limit; ++i) { + _selector.setSource(i, f(i)); + } + } +}; +} |