diff --git a/src/Makefile.bench.include b/src/Makefile.bench.include --- a/src/Makefile.bench.include +++ b/src/Makefile.bench.include @@ -30,7 +30,8 @@ bench/rpc_mempool.cpp \ bench/base58.cpp \ bench/lockedpool.cpp \ - bench/prevector.cpp + bench/prevector.cpp \ + bench/logprint.cpp nodist_bench_bench_bitcoin_SOURCES = $(GENERATED_BENCH_FILES) diff --git a/src/bench/CMakeLists.txt b/src/bench/CMakeLists.txt --- a/src/bench/CMakeLists.txt +++ b/src/bench/CMakeLists.txt @@ -48,6 +48,7 @@ examples.cpp gcs_filter.cpp lockedpool.cpp + logprint.cpp mempool_eviction.cpp merkle_root.cpp prevector.cpp diff --git a/src/bench/logprint.cpp b/src/bench/logprint.cpp new file mode 100644 --- /dev/null +++ b/src/bench/logprint.cpp @@ -0,0 +1,14 @@ +#include +#include +#include + +static void BenchmarkLogPrint(benchmark::State &state) { + SelectParams(CBaseChainParams::REGTEST); + + while (state.KeepRunning()) { + LogPrint(BCLog::NET, "%s: new block hash=%s\n", __func__, + Params().GetDefaultPort()); + } +} + +BENCHMARK(BenchmarkLogPrint, 10 * 1000 * 1000);