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.
This commit is contained in:
Patrick Strateman authored and Calvin Kim committed 2022-05-22 14:00:41 +09:00
1 parent 299023c1d9
commit aee9a8140b
1 file changed
+13
+13
View File
@@ -54,6 +54,18 @@ static void GCSFilterDecode(benchmark::Bench& bench)
});
}
static void GCSFilterDecodeSkipCheck(benchmark::Bench& bench)
{
auto elements = GenerateGCSTestElements();
GCSFilter filter({0, 0, BASIC_FILTER_P, BASIC_FILTER_M}, elements);
auto encoded = filter.GetEncoded();
bench.run([&] {
GCSFilter filter({0, 0, BASIC_FILTER_P, BASIC_FILTER_M}, encoded, /*skip_decode_check=*/true);
});
}
static void GCSFilterMatch(benchmark::Bench& bench)
{
auto elements = GenerateGCSTestElements();
@@ -67,4 +79,5 @@ static void GCSFilterMatch(benchmark::Bench& bench)
BENCHMARK(GCSBlockFilterGetHash);
BENCHMARK(GCSFilterConstruct);
BENCHMARK(GCSFilterDecode);
BENCHMARK(GCSFilterDecodeSkipCheck);
BENCHMARK(GCSFilterMatch);