 |
Bitcoin Core
22.99.0
P2P Digital Currency
|
Go to the documentation of this file.
6 #include <blockfilter.h>
11 for (
int i = 0; i < 10000; ++i) {
13 element[0] =
static_cast<unsigned char>(i);
14 element[1] =
static_cast<unsigned char>(i >> 8);
15 elements.insert(std::move(element));
18 uint64_t siphash_k0 = 0;
19 bench.
batch(elements.size()).unit(
"elem").
run([&] {
20 GCSFilter filter({siphash_k0, 0, 20, 1 << 20}, elements);
29 for (
int i = 0; i < 10000; ++i) {
31 element[0] =
static_cast<unsigned char>(i);
32 element[1] =
static_cast<unsigned char>(i >> 8);
33 elements.insert(std::move(element));
35 GCSFilter filter({0, 0, 20, 1 << 20}, elements);
ANKERL_NANOBENCH(NODISCARD) std Bench & batch(T b) noexcept
Sets the batch size.
BENCHMARK(ConstructGCSFilter)
Main entry point to nanobench's benchmarking facility.
static void MatchGCSFilter(benchmark::Bench &bench)
This implements a Golomb-coded set as defined in BIP 158.
Bench & run(char const *benchmarkName, Op &&op)
Repeatedly calls op() based on the configuration, and performs measurements.
Bench & unit(char const *unit)
Sets the operation unit.
std::unordered_set< Element, ByteVectorHash > ElementSet
static void ConstructGCSFilter(benchmark::Bench &bench)
std::vector< unsigned char > Element