Skip to content

Commit 75e15f5

Browse files
committed
Only enabling the actually relevant algo by default.
1 parent a0d4d85 commit 75e15f5

File tree

1 file changed

+29
-45
lines changed

1 file changed

+29
-45
lines changed

benchmarks/bulk-insert-and-query.cc

Lines changed: 29 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,7 @@ int main(int argc, char * argv[]) {
11071107
cout << setw(NAME_WIDTH) << names[a] << cf << endl;
11081108
}
11091109
a = 1;
1110-
if (algorithmId == a || algorithmId < 0 || (algos.find(a) != algos.end())) {
1110+
if (algorithmId == a || (algos.find(a) != algos.end())) {
11111111
auto cf = FilterBenchmark<
11121112
XorFilter2<uint64_t, uint32_t, UInt12Array, SimpleMixSplit>>(
11131113
add_count, to_add, distinct_add, to_lookup, distinct_lookup, intersectionsize, hasduplicates, mixed_sets, seed, true);
@@ -1135,35 +1135,35 @@ int main(int argc, char * argv[]) {
11351135
cout << setw(NAME_WIDTH) << names[a] << cf << endl;
11361136
}
11371137
a = 5;
1138-
if (algorithmId == a || algorithmId < 0 || (algos.find(a) != algos.end())) {
1138+
if (algorithmId == a || (algos.find(a) != algos.end())) {
11391139
auto cf = FilterBenchmark<
11401140
XorFilter10<uint64_t, SimpleMixSplit>>(
11411141
add_count, to_add, distinct_add, to_lookup, distinct_lookup, intersectionsize, hasduplicates, mixed_sets, seed, true);
11421142
cout << setw(NAME_WIDTH) << names[a] << cf << endl;
11431143
}
11441144
a = 6;
1145-
if (algorithmId == a || algorithmId < 0 || (algos.find(a) != algos.end())) {
1145+
if (algorithmId == a || (algos.find(a) != algos.end())) {
11461146
auto cf = FilterBenchmark<
11471147
XorFilter10_666<uint64_t, SimpleMixSplit>>(
11481148
add_count, to_add, distinct_add, to_lookup, distinct_lookup, intersectionsize, hasduplicates, mixed_sets, seed, true);
11491149
cout << setw(NAME_WIDTH) << names[a] << cf << endl;
11501150
}
11511151
a = 7;
1152-
if (algorithmId == a || algorithmId < 0 || (algos.find(a) != algos.end())) {
1152+
if (algorithmId == a || (algos.find(a) != algos.end())) {
11531153
auto cf = FilterBenchmark<
11541154
XorFilter2<uint64_t, uint16_t, NBitArray<uint16_t, 10>, SimpleMixSplit>>(
11551155
add_count, to_add, distinct_add, to_lookup, distinct_lookup, intersectionsize, hasduplicates, mixed_sets, seed, true);
11561156
cout << setw(NAME_WIDTH) << names[a] << cf << endl;
11571157
}
11581158
a = 8;
1159-
if (algorithmId == a || algorithmId < 0 || (algos.find(a) != algos.end())) {
1159+
if (algorithmId == a || (algos.find(a) != algos.end())) {
11601160
auto cf = FilterBenchmark<
11611161
XorFilter2<uint64_t, uint16_t, NBitArray<uint16_t, 14>, SimpleMixSplit>>(
11621162
add_count, to_add, distinct_add, to_lookup, distinct_lookup, intersectionsize, hasduplicates, mixed_sets, seed, true);
11631163
cout << setw(NAME_WIDTH) << names[a] << cf << endl;
11641164
}
11651165
a = 9;
1166-
if (algorithmId == a || algorithmId < 0 || (algos.find(a) != algos.end())) {
1166+
if (algorithmId == a || (algos.find(a) != algos.end())) {
11671167
auto cf = FilterBenchmark<
11681168
XorFilter2n<uint64_t, uint8_t, UIntArray<uint8_t>, SimpleMixSplit>>(
11691169
add_count, to_add, distinct_add, to_lookup, distinct_lookup, intersectionsize, hasduplicates, mixed_sets, seed, true);
@@ -1172,7 +1172,7 @@ int main(int argc, char * argv[]) {
11721172

11731173
// Cuckoo ----------------------------------------------------------
11741174
a = 10;
1175-
if (algorithmId == a || algorithmId < 0 || (algos.find(a) != algos.end())) {
1175+
if (algorithmId == a || (algos.find(a) != algos.end())) {
11761176
auto cf = FilterBenchmark<
11771177
CuckooFilterStable<uint64_t, 8, SingleTable, SimpleMixSplit>>(
11781178
add_count, to_add, distinct_add, to_lookup, distinct_lookup, intersectionsize, hasduplicates, mixed_sets, seed, false, true);
@@ -1200,28 +1200,28 @@ int main(int argc, char * argv[]) {
12001200
cout << setw(NAME_WIDTH) << names[a] << cf << endl;
12011201
}
12021202
a = 14;
1203-
if (algorithmId == a || algorithmId < 0 || (algos.find(a) != algos.end())) {
1203+
if (algorithmId == a || (algos.find(a) != algos.end())) {
12041204
auto cf = FilterBenchmark<
12051205
CuckooFilter<uint64_t, 8, SingleTable, SimpleMixSplit>>(
12061206
add_count, to_add, distinct_add, to_lookup, distinct_lookup, intersectionsize, hasduplicates, mixed_sets, seed, false, true);
12071207
cout << setw(NAME_WIDTH) << names[a] << cf << endl;
12081208
}
12091209
a = 15;
1210-
if (algorithmId == a || algorithmId < 0 || (algos.find(a) != algos.end())) {
1210+
if (algorithmId == a || (algos.find(a) != algos.end())) {
12111211
auto cf = FilterBenchmark<
12121212
CuckooFilter<uint64_t, 12, SingleTable, SimpleMixSplit>>(
12131213
add_count, to_add, distinct_add, to_lookup, distinct_lookup, intersectionsize, hasduplicates, mixed_sets, seed, false, true);
12141214
cout << setw(NAME_WIDTH) << names[a] << cf << endl;
12151215
}
12161216
a = 16;
1217-
if (algorithmId == a || algorithmId < 0 || (algos.find(a) != algos.end())) {
1217+
if (algorithmId == a || (algos.find(a) != algos.end())) {
12181218
auto cf = FilterBenchmark<
12191219
CuckooFilter<uint64_t, 16, SingleTable, SimpleMixSplit>>(
12201220
add_count, to_add, distinct_add, to_lookup, distinct_lookup, intersectionsize, hasduplicates, mixed_sets, seed, false, true);
12211221
cout << setw(NAME_WIDTH) << names[a] << cf << endl;
12221222
}
12231223
a = 17;
1224-
if (algorithmId == a || algorithmId < 0 || (algos.find(a) != algos.end())) {
1224+
if (algorithmId == a || (algos.find(a) != algos.end())) {
12251225
auto cf = FilterBenchmark<
12261226
CuckooFilter<uint64_t, 13, PackedTable, SimpleMixSplit>>(
12271227
add_count, to_add, distinct_add, to_lookup, distinct_lookup, intersectionsize, hasduplicates, mixed_sets, seed, false, true);
@@ -1240,7 +1240,7 @@ int main(int argc, char * argv[]) {
12401240
// CQF ----------------------------------------------------------
12411241
#ifdef __AVX2__
12421242
a = 30;
1243-
if (algorithmId == a || algorithmId < 0 || (algos.find(a) != algos.end())) {
1243+
if (algorithmId == a || (algos.find(a) != algos.end())) {
12441244
auto cf = FilterBenchmark<
12451245
GQFilter<uint64_t, 8, SimpleMixSplit>>(
12461246
add_count, to_add, distinct_add, to_lookup, distinct_lookup, intersectionsize, hasduplicates, mixed_sets, seed, false, true);
@@ -1271,50 +1271,50 @@ int main(int argc, char * argv[]) {
12711271
cout << setw(NAME_WIDTH) << names[a] << cf << endl;
12721272
}
12731273
a = 43;
1274-
if (algorithmId == a || algorithmId < 0 || (algos.find(a) != algos.end())) {
1274+
if (algorithmId == a || (algos.find(a) != algos.end())) {
12751275
auto cf = FilterBenchmark<
12761276
BloomFilter<uint64_t, 8, false, SimpleMixSplit>>(
12771277
add_count, to_add, distinct_add, to_lookup, distinct_lookup, intersectionsize, hasduplicates, mixed_sets, seed, true);
12781278
cout << setw(NAME_WIDTH) << names[a] << cf << endl;
12791279
}
12801280
a = 44;
1281-
if (algorithmId == a || algorithmId < 0 || (algos.find(a) != algos.end())) {
1281+
if (algorithmId == a || (algos.find(a) != algos.end())) {
12821282
auto cf = FilterBenchmark<
12831283
BloomFilter<uint64_t, 12, false, SimpleMixSplit>>(
12841284
add_count, to_add, distinct_add, to_lookup, distinct_lookup, intersectionsize, hasduplicates, mixed_sets, seed, true);
12851285
cout << setw(NAME_WIDTH) << names[a] << cf << endl;
12861286
}
12871287
a = 45;
1288-
if (algorithmId == a || algorithmId < 0 || (algos.find(a) != algos.end())) {
1288+
if (algorithmId == a || (algos.find(a) != algos.end())) {
12891289
auto cf = FilterBenchmark<
12901290
BloomFilter<uint64_t, 16, false, SimpleMixSplit>>(
12911291
add_count, to_add, distinct_add, to_lookup, distinct_lookup, intersectionsize, hasduplicates, mixed_sets, seed, true);
12921292
cout << setw(NAME_WIDTH) << names[a] << cf << endl;
12931293
}
12941294
a = 46;
1295-
if (algorithmId == a || algorithmId < 0 || (algos.find(a) != algos.end())) {
1295+
if (algorithmId == a || (algos.find(a) != algos.end())) {
12961296
auto cf = FilterBenchmark<
12971297
BloomFilter<uint64_t, 8, true, SimpleMixSplit>>(
12981298
add_count, to_add, distinct_add, to_lookup, distinct_lookup, intersectionsize, hasduplicates, mixed_sets, seed, true);
12991299
cout << setw(NAME_WIDTH) << names[a] << cf << endl;
13001300
}
13011301
a = 47;
1302-
if (algorithmId == a || algorithmId < 0 || (algos.find(a) != algos.end())) {
1302+
if (algorithmId == a || (algos.find(a) != algos.end())) {
13031303
auto cf = FilterBenchmark<
13041304
BloomFilter<uint64_t, 12, true, SimpleMixSplit>>(
13051305
add_count, to_add, distinct_add, to_lookup, distinct_lookup, intersectionsize, hasduplicates, mixed_sets, seed, true);
13061306
cout << setw(NAME_WIDTH) << names[a] << cf << endl;
13071307
}
13081308
a = 48;
1309-
if (algorithmId == a || algorithmId < 0 || (algos.find(a) != algos.end())) {
1309+
if (algorithmId == a || (algos.find(a) != algos.end())) {
13101310
auto cf = FilterBenchmark<
13111311
BloomFilter<uint64_t, 16, true, SimpleMixSplit>>(
13121312
add_count, to_add, distinct_add, to_lookup, distinct_lookup, intersectionsize, hasduplicates, mixed_sets, seed, true);
13131313
cout << setw(NAME_WIDTH) << names[a] << cf << endl;
13141314
}
13151315

13161316
a = 48;
1317-
if (algorithmId == a || algorithmId < 0 || (algos.find(a) != algos.end())) {
1317+
if (algorithmId == a || (algos.find(a) != algos.end())) {
13181318
auto cf = FilterBenchmark<
13191319
BloomFilter<uint64_t, 16, true, SimpleMixSplit>>(
13201320
add_count, to_add, distinct_add, to_lookup, distinct_lookup, intersectionsize, hasduplicates, mixed_sets, seed, true);
@@ -1323,7 +1323,7 @@ int main(int argc, char * argv[]) {
13231323

13241324
// Blocked Bloom ----------------------------------------------------------
13251325
a = 50;
1326-
if (algorithmId == a || algorithmId < 0 || (algos.find(a) != algos.end())) {
1326+
if (algorithmId == a || (algos.find(a) != algos.end())) {
13271327
auto cf = FilterBenchmark<
13281328
SimpleBlockFilter<8, 8, SimpleMixSplit>>(
13291329
add_count, to_add, distinct_add, to_lookup, distinct_lookup, intersectionsize, hasduplicates, mixed_sets, seed, false);
@@ -1337,7 +1337,7 @@ int main(int argc, char * argv[]) {
13371337
cout << setw(NAME_WIDTH) << names[a] << cf << endl;
13381338
}
13391339
a = 52;
1340-
if (algorithmId == a || algorithmId < 0 || (algos.find(a) != algos.end())) {
1340+
if (algorithmId == a || (algos.find(a) != algos.end())) {
13411341
auto cf = FilterBenchmark<SimdBlockFilterFixed<SimpleMixSplit>>(
13421342
add_count, to_add, distinct_add, to_lookup, distinct_lookup, intersectionsize, hasduplicates, mixed_sets, seed, true);
13431343
cout << setw(NAME_WIDTH) << names[a] << cf << endl;
@@ -1351,21 +1351,21 @@ int main(int argc, char * argv[]) {
13511351
cout << setw(NAME_WIDTH) << names[a] << cf << endl;
13521352
}
13531353
a = 52;
1354-
if (algorithmId == a || algorithmId < 0 || (algos.find(a) != algos.end())) {
1354+
if (algorithmId == a || (algos.find(a) != algos.end())) {
13551355
auto cf = FilterBenchmark<SimdBlockFilterFixed<SimpleMixSplit>>(
13561356
add_count, to_add, distinct_add, to_lookup, distinct_lookup, intersectionsize, hasduplicates, mixed_sets, seed, true);
13571357
cout << setw(NAME_WIDTH) << names[a] << cf << endl;
13581358
}
13591359
a = 53;
1360-
if (algorithmId == a || algorithmId < 0 || (algos.find(a) != algos.end())) {
1360+
if (algorithmId == a || (algos.find(a) != algos.end())) {
13611361
auto cf = FilterBenchmark<SimdBlockFilterFixed64<SimpleMixSplit>>(
13621362
add_count, to_add, distinct_add, to_lookup, distinct_lookup, intersectionsize, hasduplicates, mixed_sets, seed);
13631363
cout << setw(NAME_WIDTH) << names[a] << cf << endl;
13641364
}
13651365
#endif
13661366
#ifdef __SSSE3__
13671367
a = 54;
1368-
if (algorithmId == a || algorithmId < 0 || (algos.find(a) != algos.end())) {
1368+
if (algorithmId == a || (algos.find(a) != algos.end())) {
13691369
auto cf = FilterBenchmark<SimdBlockFilterFixed16<SimpleMixSplit>>(
13701370
add_count, to_add, distinct_add, to_lookup, distinct_lookup, intersectionsize, hasduplicates, mixed_sets, seed);
13711371
cout << setw(NAME_WIDTH) << names[a] << cf << endl;
@@ -1374,37 +1374,37 @@ int main(int argc, char * argv[]) {
13741374

13751375
// Counting Bloom ----------------------------------------------------------
13761376
a = 60;
1377-
if (algorithmId == a || algorithmId < 0 || (algos.find(a) != algos.end())) {
1377+
if (algorithmId == a || (algos.find(a) != algos.end())) {
13781378
auto cf = FilterBenchmark<
13791379
CountingBloomFilter<uint64_t, 10, true, SimpleMixSplit>>(
13801380
add_count, to_add, distinct_add, to_lookup, distinct_lookup, intersectionsize, hasduplicates, mixed_sets, seed, true, true);
13811381
cout << setw(NAME_WIDTH) << names[a] << cf << endl;
13821382
}
13831383
a = 61;
1384-
if (algorithmId == a || algorithmId < 0 || (algos.find(a) != algos.end())) {
1384+
if (algorithmId == a || (algos.find(a) != algos.end())) {
13851385
auto cf = FilterBenchmark<
13861386
SuccinctCountingBloomFilter<uint64_t, 10, true, SimpleMixSplit>>(
13871387
add_count, to_add, distinct_add, to_lookup, distinct_lookup, intersectionsize, hasduplicates, mixed_sets, seed, true, true);
13881388
cout << setw(NAME_WIDTH) << names[a] << cf << endl;
13891389
}
13901390
a = 62;
1391-
if (algorithmId == a || algorithmId < 0 || (algos.find(a) != algos.end())) {
1391+
if (algorithmId == a || (algos.find(a) != algos.end())) {
13921392
auto cf = FilterBenchmark<
13931393
SuccinctCountingBlockedBloomFilter<uint64_t, 10, SimpleMixSplit>>(
13941394
add_count, to_add, distinct_add, to_lookup, distinct_lookup, intersectionsize, hasduplicates, mixed_sets, seed, false, true);
13951395
cout << setw(NAME_WIDTH) << names[a] << cf << endl;
13961396
}
13971397

13981398
a = 70;
1399-
if (algorithmId == a || algorithmId < 0 || (algos.find(a) != algos.end())) {
1399+
if (algorithmId == a || (algos.find(a) != algos.end())) {
14001400
auto cf = FilterBenchmark<
14011401
XorSingle>(
14021402
add_count, to_add, distinct_add, to_lookup, distinct_lookup, intersectionsize, hasduplicates, mixed_sets, seed, true);
14031403
cout << setw(NAME_WIDTH) << names[a] << cf << endl;
14041404
}
14051405

14061406
a = 80;
1407-
if (algorithmId == a || algorithmId < 0 || (algos.find(a) != algos.end())) {
1407+
if (algorithmId == a || (algos.find(a) != algos.end())) {
14081408
auto cf = FilterBenchmark<
14091409
MortonFilter>(
14101410
add_count, to_add, distinct_add, to_lookup, distinct_lookup, intersectionsize, hasduplicates, mixed_sets, seed, true);
@@ -1420,21 +1420,5 @@ int main(int argc, char * argv[]) {
14201420
std::cout << "Sort time: " << sort_time / to_add.size() << " ns/key\n";
14211421
}
14221422

1423-
// broken algorithms (don't always find all key)
1424-
/*
1425-
if (algorithmId == 25) {
1426-
auto cf = FilterBenchmark<
1427-
CuckooFilter<uint64_t, 9, PackedTable, SimpleMixSplit>>(
1428-
add_count, to_add, distinct_add, to_lookup, distinct_lookup, intersectionsize, hasduplicates, mixed_sets, seed);
1429-
cout << setw(NAME_WIDTH) << "CuckooSemiSort9-2^n" << cf << endl;
1430-
}
1431-
1432-
if (algorithmId == 26) {
1433-
auto cf = FilterBenchmark<
1434-
CuckooFilter<uint64_t, 17, PackedTable, SimpleMixSplit>>(
1435-
add_count, to_add, distinct_add, to_lookup, distinct_lookup, intersectionsize, hasduplicates, mixed_sets, seed);
1436-
cout << setw(NAME_WIDTH) << "CuckooSemiSort17-2^n" << cf << endl;
1437-
}
1438-
*/
14391423

14401424
}

0 commit comments

Comments
 (0)