mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-02 09:46:52 -05:00
bench: add benchmark for checkblockindex
This commit is contained in:
parent
b50554babd
commit
32c80413fd
2 changed files with 21 additions and 0 deletions
|
@ -23,6 +23,7 @@ bench_bench_bitcoin_SOURCES = \
|
||||||
bench/ccoins_caching.cpp \
|
bench/ccoins_caching.cpp \
|
||||||
bench/chacha20.cpp \
|
bench/chacha20.cpp \
|
||||||
bench/checkblock.cpp \
|
bench/checkblock.cpp \
|
||||||
|
bench/checkblockindex.cpp \
|
||||||
bench/checkqueue.cpp \
|
bench/checkqueue.cpp \
|
||||||
bench/crypto_hash.cpp \
|
bench/crypto_hash.cpp \
|
||||||
bench/data.cpp \
|
bench/data.cpp \
|
||||||
|
|
20
src/bench/checkblockindex.cpp
Normal file
20
src/bench/checkblockindex.cpp
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
// Copyright (c) 2023-present The Bitcoin Core developers
|
||||||
|
// Distributed under the MIT software license, see the accompanying
|
||||||
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
|
#include <bench/bench.h>
|
||||||
|
#include <test/util/setup_common.h>
|
||||||
|
#include <validation.h>
|
||||||
|
|
||||||
|
static void CheckBlockIndex(benchmark::Bench& bench)
|
||||||
|
{
|
||||||
|
auto testing_setup{MakeNoLogFileContext<TestChain100Setup>()};
|
||||||
|
// Mine some more blocks
|
||||||
|
testing_setup->mineBlocks(1000);
|
||||||
|
bench.run([&] {
|
||||||
|
testing_setup->m_node.chainman->CheckBlockIndex();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BENCHMARK(CheckBlockIndex, benchmark::PriorityLevel::HIGH);
|
Loading…
Add table
Reference in a new issue