Bitcoin Core  27.99.0
P2P Digital Currency
load_external.cpp File Reference
#include <bench/bench.h>
#include <bench/data.h>
#include <chainparams.h>
#include <clientversion.h>
#include <test/util/setup_common.h>
#include <util/chaintype.h>
#include <validation.h>
Include dependency graph for load_external.cpp:

Go to the source code of this file.


static void LoadExternalBlockFile (benchmark::Bench &bench)
 The LoadExternalBlockFile() function is used during -reindex and -loadblock. More...
 BENCHMARK (LoadExternalBlockFile, benchmark::PriorityLevel::HIGH)

Function Documentation


◆ LoadExternalBlockFile()

static void LoadExternalBlockFile ( benchmark::Bench bench)

The LoadExternalBlockFile() function is used during -reindex and -loadblock.

Create a test file that's similar to a datadir/blocks/blk?????.dat file, It contains around 134 copies of the same block (typical size of real block files). For each block in the file, LoadExternalBlockFile() won't find its parent, and so will skip the block. (In the real system, it will re-read the block from disk later when it encounters its parent.)

This benchmark measures the performance of deserializing the block (or just its header, beginning with PR 16981).

Definition at line 25 of file load_external.cpp.

Here is the call graph for this function: