6#include <bench/data/block413567.raw.h>
7#include <chainparams.h>
15#include <validation.h>
38 const auto testing_setup{MakeNoLogFileContext<const TestingSetup>(
ChainType::MAIN)};
42 const fs::path blkfile{testing_setup.get()->m_path_root /
"blk.dat"};
44 auto params{testing_setup->m_node.chainman->GetParams()};
45 ss << params.MessageStart();
46 ss << static_cast<uint32_t>(benchmark::data::block413567.size());
49 ss <<
Span{benchmark::data::block413567};
57 if (fwrite(ss.data(), 1, ss.size(), file) != ss.size()) {
58 throw std::runtime_error(
"write to test file failed\n");
64 std::multimap<uint256, FlatFilePos> blocks_with_unknown_parent;
70 testing_setup->m_node.chainman->LoadExternalBlockFile(file, &pos, &blocks_with_unknown_parent);
Non-refcounted RAII wrapper for FILE*.
Double ended buffer combining vector and stream-like interfaces.
A Span is an object that can refer to a contiguous sequence of objects.
Main entry point to nanobench's benchmarking facility.
Bench & run(char const *benchmarkName, Op &&op)
Repeatedly calls op() based on the configuration, and performs measurements.
Path class wrapper to block calls to the fs::path(std::string) implicit constructor and the fs::path:...
BENCHMARK(LoadExternalBlockFile, benchmark::PriorityLevel::HIGH)
static void LoadExternalBlockFile(benchmark::Bench &bench)
The LoadExternalBlockFile() function is used during -reindex and -loadblock.
FILE * fopen(const fs::path &p, const char *mode)
static const unsigned int MAX_BLOCKFILE_SIZE
The maximum size of a blk?????.dat file (since 0.8)