diff --git a/src/Makefile.bench.include b/src/Makefile.bench.include index 7ba0111fa686f..e4717ffd15b45 100644 --- a/src/Makefile.bench.include +++ b/src/Makefile.bench.include @@ -32,6 +32,7 @@ bench_bench_bitcoin_SOURCES = \ bench/duplicate_inputs.cpp \ bench/ellswift.cpp \ bench/examples.cpp \ + bench/feefrac_mul.cpp \ bench/gcs_filter.cpp \ bench/hashpadding.cpp \ bench/index_blockfilter.cpp \ diff --git a/src/bench/feefrac_mul.cpp b/src/bench/feefrac_mul.cpp new file mode 100644 index 0000000000000..a18995ea00363 --- /dev/null +++ b/src/bench/feefrac_mul.cpp @@ -0,0 +1,26 @@ +// Copyright (c) 2024-present The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or https://www.opensource.org/licenses/mit-license.php. + +#include +#include +#include + +#include +#include + +static void FeefracMultipication(benchmark::Bench& bench) +{ + FastRandomContext rnd; + uint64_t a64 = rnd.rand64(); + uint32_t b32 = rnd.rand32(); + uint64_t c64 = rnd.rand64(); + uint32_t d32 = rnd.rand32(); + bench.minEpochIterations(10000000).run([&] { + FeeRateCompare( + FeeFrac(std::bit_cast(a64++), std::bit_cast(b32++)), + FeeFrac(std::bit_cast(c64++), std::bit_cast(d32++))); + }); +} + +BENCHMARK(FeefracMultipication, benchmark::PriorityLevel::HIGH);