Changeset View
Changeset View
Standalone View
Standalone View
src/bench/bench.cpp
// Copyright (c) 2015-2019 The Bitcoin Core developers | // Copyright (c) 2015-2019 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#include <bench/bench.h> | #include <bench/bench.h> | ||||
#include <chainparams.h> | |||||
#include <validation.h> | |||||
#include <test/test_bitcoin.h> | |||||
#include <algorithm> | #include <algorithm> | ||||
#include <cassert> | #include <cassert> | ||||
#include <iomanip> | #include <iomanip> | ||||
#include <iostream> | #include <iostream> | ||||
#include <numeric> | #include <numeric> | ||||
#include <regex> | #include <regex> | ||||
void benchmark::ConsolePrinter::header() { | void benchmark::ConsolePrinter::header() { | ||||
▲ Show 20 Lines • Show All 90 Lines • ▼ Show 20 Lines | |||||
#endif | #endif | ||||
std::regex reFilter(filter); | std::regex reFilter(filter); | ||||
std::smatch baseMatch; | std::smatch baseMatch; | ||||
printer.header(); | printer.header(); | ||||
for (const auto &p : benchmarks()) { | for (const auto &p : benchmarks()) { | ||||
TestingSetup test{CBaseChainParams::REGTEST}; | |||||
assert(::ChainActive().Height() == 0); | |||||
if (!std::regex_match(p.first, baseMatch, reFilter)) { | if (!std::regex_match(p.first, baseMatch, reFilter)) { | ||||
continue; | continue; | ||||
} | } | ||||
uint64_t num_iters = | uint64_t num_iters = | ||||
static_cast<uint64_t>(p.second.num_iters_for_one_second * scaling); | static_cast<uint64_t>(p.second.num_iters_for_one_second * scaling); | ||||
if (0 == num_iters) { | if (0 == num_iters) { | ||||
num_iters = 1; | num_iters = 1; | ||||
Show All 24 Lines |