mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-22 15:04:44 +01: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
1 changed files with 13 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue