MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / ReadRawBlockBench

Function ReadRawBlockBench

src/bench/readwriteblock.cpp:56–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56static void ReadRawBlockBench(benchmark::Bench& bench)
57{
58 const auto testing_setup{MakeNoLogFileContext<const TestingSetup>(ChainType::MAIN)};
59 auto& blockman{testing_setup->m_node.chainman->m_blockman};
60 const auto pos{WITH_LOCK(::cs_main, return blockman.WriteBlock(CreateTestBlock(), 413'567))};
61 bench.run([&] {
62 const auto res{blockman.ReadRawBlock(pos)};
63 assert(res);
64 });
65}
66
67BENCHMARK(WriteBlockBench);
68BENCHMARK(ReadBlockBench);

Callers

nothing calls this directly

Calls 2

ReadRawBlockMethod · 0.80
runMethod · 0.45

Tested by

no test coverage detected