From 6fcdda5bd19b786adc9350106d20f8f96b1b4f07 Mon Sep 17 00:00:00 2001 From: Geir Storli Date: Thu, 8 Feb 2024 08:25:34 +0000 Subject: 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. --- searchcore/src/tests/grouping/grouping_test.cpp | 8 ++++---- searchcore/src/tests/proton/matching/matching_test.cpp | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'searchcore') 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("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("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("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("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("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("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("a3"); AttributeVector::DocId docid(0); for (uint32_t i = 0; i < NUM_DOCS; ++i) { attr->addDoc(docid); -- cgit v1.2.3