Skip to content

Commit 9bc380d

Browse files
committed
Blocked Bloom filter: bulk insert (faster only in the 100m case, and only about 10%)
1 parent e7ef113 commit 9bc380d

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

benchmarks/bulk-insert-and-query.cc

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ struct FilterAPI<SimdBlockFilterFixed<HashFamily>> {
198198
table->Add(key);
199199
}
200200
static void AddAll(const vector<uint64_t> keys, const size_t start, const size_t end, Table* table) {
201-
throw std::runtime_error("Unsupported");
201+
table->AddAll(keys, start, end);
202202
}
203203

204204
CONTAIN_ATTRIBUTES
@@ -408,7 +408,7 @@ typedef struct samples samples_t;
408408

409409
template <typename Table>
410410
Statistics FilterBenchmark(
411-
size_t add_count, const vector<uint64_t>& to_add, size_t distinct_add, const vector<uint64_t>& to_lookup, size_t distinct_lookup,
411+
size_t add_count, const vector<uint64_t>& to_add, size_t distinct_add, const vector<uint64_t>& to_lookup, size_t distinct_lookup,
412412
size_t intersectionsize, bool hasduplicates,
413413
const std::vector<samples_t> & mixed_sets, int seed, bool batchedadd = false) {
414414
if (add_count > to_add.size()) {
@@ -503,7 +503,7 @@ Statistics FilterBenchmark(
503503
}
504504
#ifndef __linux__
505505
std::cout <<"\r"; // roll back the line
506-
#endif
506+
#endif
507507
return result;
508508
}
509509

@@ -550,7 +550,8 @@ int main(int argc, char * argv[]) {
550550
{8,"Bloom12" }, {9,"Bloom16"}, {10,"BlockedBloom"},
551551
{11,"sort"}, {12,"Xor+8"}, {13,"Xor+16"},
552552
{14,"GCS"}, {15,"CQF"}, {37,"Bloom8 (addall)"},
553-
{38,"Bloom12 (addall)"},{39,"Bloom16 (addall)"}
553+
{38,"Bloom12 (addall)"},{39,"Bloom16 (addall)"},
554+
{40,"BlockedBloom (addall)"}
554555
};
555556
if (argc < 2) {
556557
cout << "Usage: " << argv[0] << " <numberOfEntries> [<algorithmId> [<seed>]]" << endl;
@@ -576,7 +577,7 @@ int main(int argc, char * argv[]) {
576577
if(strstr(argv[2],",") != NULL) {
577578
// we have a list of algos
578579
algorithmId = 9999999; // disabling
579-
parse_comma_separated(argv[2], algos);
580+
parse_comma_separated(argv[2], algos);
580581
} else {
581582
stringstream input_string_2(argv[2]);
582583
input_string_2 >> algorithmId;
@@ -887,6 +888,15 @@ int main(int argc, char * argv[]) {
887888
cout << setw(NAME_WIDTH) << names[39] << cf << endl;
888889
}
889890

891+
#ifdef __AVX2__
892+
if (algorithmId == 40 || algorithmId < 0) {
893+
auto cf = FilterBenchmark<SimdBlockFilterFixed<SimpleMixSplit>>(
894+
add_count, to_add, to_lookup, seed, true);
895+
cout << setw(NAME_WIDTH) << names[40] << cf << endl;
896+
}
897+
#endif
898+
899+
890900

891901
// broken algorithms (don't always find all key)
892902
/*

0 commit comments

Comments
 (0)