mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-05-17 23:56:39 +00:00
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:
parent
299023c1d9
commit
aee9a8140b
@ -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)
|
static void GCSFilterMatch(benchmark::Bench& bench)
|
||||||
{
|
{
|
||||||
auto elements = GenerateGCSTestElements();
|
auto elements = GenerateGCSTestElements();
|
||||||
@ -67,4 +79,5 @@ static void GCSFilterMatch(benchmark::Bench& bench)
|
|||||||
BENCHMARK(GCSBlockFilterGetHash);
|
BENCHMARK(GCSBlockFilterGetHash);
|
||||||
BENCHMARK(GCSFilterConstruct);
|
BENCHMARK(GCSFilterConstruct);
|
||||||
BENCHMARK(GCSFilterDecode);
|
BENCHMARK(GCSFilterDecode);
|
||||||
|
BENCHMARK(GCSFilterDecodeSkipCheck);
|
||||||
BENCHMARK(GCSFilterMatch);
|
BENCHMARK(GCSFilterMatch);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user