refactor,bench: rename bench/readblock.cpp to bench/readwriteblock.cpp

Done in separate commit to simplify review.
Also renames benchmarks, since they're not strictly tests.

Co-authored-by: Hodlinator <172445034+hodlinator@users.noreply.github.com>
This commit is contained in:
Lőrinc 2025-01-09 12:41:44 +01:00
parent 228aba2c4d
commit 34f9a0157a
2 changed files with 5 additions and 5 deletions

View file

@ -44,7 +44,7 @@ add_executable(bench_bitcoin
pool.cpp pool.cpp
prevector.cpp prevector.cpp
random.cpp random.cpp
readblock.cpp readwriteblock.cpp
rollingbloom.cpp rollingbloom.cpp
rpc_blockchain.cpp rpc_blockchain.cpp
rpc_mempool.cpp rpc_mempool.cpp

View file

@ -28,7 +28,7 @@ static FlatFilePos WriteBlockToDisk(ChainstateManager& chainman)
return chainman.m_blockman.SaveBlockToDisk(block, 0); return chainman.m_blockman.SaveBlockToDisk(block, 0);
} }
static void ReadBlockFromDiskTest(benchmark::Bench& bench) static void ReadBlockFromDiskBench(benchmark::Bench& bench)
{ {
const auto testing_setup{MakeNoLogFileContext<const TestingSetup>(ChainType::MAIN)}; const auto testing_setup{MakeNoLogFileContext<const TestingSetup>(ChainType::MAIN)};
ChainstateManager& chainman{*testing_setup->m_node.chainman}; ChainstateManager& chainman{*testing_setup->m_node.chainman};
@ -42,7 +42,7 @@ static void ReadBlockFromDiskTest(benchmark::Bench& bench)
}); });
} }
static void ReadRawBlockFromDiskTest(benchmark::Bench& bench) static void ReadRawBlockFromDiskBench(benchmark::Bench& bench)
{ {
const auto testing_setup{MakeNoLogFileContext<const TestingSetup>(ChainType::MAIN)}; const auto testing_setup{MakeNoLogFileContext<const TestingSetup>(ChainType::MAIN)};
ChainstateManager& chainman{*testing_setup->m_node.chainman}; ChainstateManager& chainman{*testing_setup->m_node.chainman};
@ -56,5 +56,5 @@ static void ReadRawBlockFromDiskTest(benchmark::Bench& bench)
}); });
} }
BENCHMARK(ReadBlockFromDiskTest, benchmark::PriorityLevel::HIGH); BENCHMARK(ReadBlockFromDiskBench, benchmark::PriorityLevel::HIGH);
BENCHMARK(ReadRawBlockFromDiskTest, benchmark::PriorityLevel::HIGH); BENCHMARK(ReadRawBlockFromDiskBench, benchmark::PriorityLevel::HIGH);