diff options
author | Geir Storli <geirst@yahooinc.com> | 2024-02-08 08:25:34 +0000 |
---|---|---|
committer | Geir Storli <geirst@yahooinc.com> | 2024-02-08 09:17:30 +0000 |
commit | 6fcdda5bd19b786adc9350106d20f8f96b1b4f07 (patch) | |
tree | dc64dcbd059e1b341e2f8278ffe8e77c2f28d1eb /searchcore/src | |
parent | 35530c2572a37e0d26fe0506f168f4fb7ee44cf5 (diff) |
Add low-level benchmark program for search iterators.
Currently, it can benchmark the following query operators over an attribute vector:
Single term, In, WeightedSet, DotProduct, Or.
Diffstat (limited to 'searchcore/src')
-rw-r--r-- | searchcore/src/tests/grouping/grouping_test.cpp | 8 | ||||
-rw-r--r-- | searchcore/src/tests/proton/matching/matching_test.cpp | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/searchcore/src/tests/grouping/grouping_test.cpp b/searchcore/src/tests/grouping/grouping_test.cpp index 905384416e6..e77bc4e9e22 100644 --- a/searchcore/src/tests/grouping/grouping_test.cpp +++ b/searchcore/src/tests/grouping/grouping_test.cpp @@ -45,7 +45,7 @@ struct MyWorld { bv.setInterval(0, NUM_DOCS); // attribute context { - auto *attr = new SingleInt32ExtAttribute("attr0"); + auto attr = std::make_shared<SingleInt32ExtAttribute>("attr0"); AttributeVector::DocId docid; for (uint32_t i = 0; i < NUM_DOCS; ++i) { attr->addDoc(docid); @@ -55,7 +55,7 @@ struct MyWorld { attributeContext.add(attr); } { - auto *attr = new SingleInt32ExtAttribute("attr1"); + auto attr = std::make_shared<SingleInt32ExtAttribute>("attr1"); AttributeVector::DocId docid; for (uint32_t i = 0; i < NUM_DOCS; ++i) { attr->addDoc(docid); @@ -65,7 +65,7 @@ struct MyWorld { attributeContext.add(attr); } { - auto *attr = new SingleInt32ExtAttribute("attr2"); + auto attr = std::make_shared<SingleInt32ExtAttribute>("attr2"); AttributeVector::DocId docid; for (uint32_t i = 0; i < NUM_DOCS; ++i) { attr->addDoc(docid); @@ -75,7 +75,7 @@ struct MyWorld { attributeContext.add(attr); } { - auto *attr = new SingleInt32ExtAttribute("attr3"); + auto attr = std::make_shared<SingleInt32ExtAttribute>("attr3"); AttributeVector::DocId docid; for (uint32_t i = 0; i < NUM_DOCS; ++i) { attr->addDoc(docid); diff --git a/searchcore/src/tests/proton/matching/matching_test.cpp b/searchcore/src/tests/proton/matching/matching_test.cpp index 02506afa709..6dd8a93bcbd 100644 --- a/searchcore/src/tests/proton/matching/matching_test.cpp +++ b/searchcore/src/tests/proton/matching/matching_test.cpp @@ -174,7 +174,7 @@ struct MyWorld { // attribute context { - SingleInt32ExtAttribute *attr = new SingleInt32ExtAttribute("a1"); + auto attr = std::make_shared<SingleInt32ExtAttribute>("a1"); AttributeVector::DocId docid(0); for (uint32_t i = 0; i < NUM_DOCS; ++i) { attr->addDoc(docid); @@ -184,7 +184,7 @@ struct MyWorld { attributeContext.add(attr); } { - auto *attr = new SingleInt32ExtAttribute("a2"); + auto attr = std::make_shared<SingleInt32ExtAttribute>("a2"); AttributeVector::DocId docid(0); for (uint32_t i = 0; i < NUM_DOCS; ++i) { attr->addDoc(docid); @@ -194,7 +194,7 @@ struct MyWorld { attributeContext.add(attr); } { - auto *attr = new SingleInt32ExtAttribute("a3"); + auto attr = std::make_shared<SingleInt32ExtAttribute>("a3"); AttributeVector::DocId docid(0); for (uint32_t i = 0; i < NUM_DOCS; ++i) { attr->addDoc(docid); |