Skip to content

Commit aee9a81

Browse files
pstratemkcalvinalvin
authored andcommitted
Add GCSFilterDecodeSkipCheck benchmark
This benchmark allows us to compare the differences between doing the sanity check for corruption via GolombRiceDecode() vs checking the hash of the encoded block filter.
1 parent 299023c commit aee9a81

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/bench/gcs_filter.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,18 @@ static void GCSFilterDecode(benchmark::Bench& bench)
5454
});
5555
}
5656

57+
static void GCSFilterDecodeSkipCheck(benchmark::Bench& bench)
58+
{
59+
auto elements = GenerateGCSTestElements();
60+
61+
GCSFilter filter({0, 0, BASIC_FILTER_P, BASIC_FILTER_M}, elements);
62+
auto encoded = filter.GetEncoded();
63+
64+
bench.run([&] {
65+
GCSFilter filter({0, 0, BASIC_FILTER_P, BASIC_FILTER_M}, encoded, /*skip_decode_check=*/true);
66+
});
67+
}
68+
5769
static void GCSFilterMatch(benchmark::Bench& bench)
5870
{
5971
auto elements = GenerateGCSTestElements();
@@ -67,4 +79,5 @@ static void GCSFilterMatch(benchmark::Bench& bench)
6779
BENCHMARK(GCSBlockFilterGetHash);
6880
BENCHMARK(GCSFilterConstruct);
6981
BENCHMARK(GCSFilterDecode);
82+
BENCHMARK(GCSFilterDecodeSkipCheck);
7083
BENCHMARK(GCSFilterMatch);

0 commit comments

Comments
 (0)