 |
Bitcoin Core
22.99.0
P2P Digital Currency
|
Go to the documentation of this file.
36 std::stringstream ss(str);
37 std::vector<double> numbers;
47 int main(
int argc,
char** argv)
59 std::cout <<
"Usage: bench_bitcoin [options]\n"
64 " bench_bitcoin executes microbenchmarks. The quality of the benchmark results\n"
65 " highly depend on the stability of the machine. It can sometimes be difficult\n"
66 " to get stable, repeatable results, so here are a few tips:\n"
68 " * Use pyperf [1] to disable frequency scaling, turbo boost etc. For best\n"
69 " results, use CPU pinning and CPU isolation (see [2]).\n"
71 " * Each call of run() should do exactly the same work. E.g. inserting into\n"
72 " a std::vector doesn't do that as it will reallocate on certain calls. Make\n"
73 " sure each run has exactly the same preconditions.\n"
75 " * If results are still not reliable, increase runtime with e.g.\n"
76 " -min_time=5000 to let a benchmark run for at least 5 seconds.\n"
78 " * bench_bitcoin uses nanobench [3] for which there is extensive\n"
79 " documentation available online.\n"
81 "Environment Variables:\n"
83 " To attach a profiler you can run a benchmark in endless mode. This can be\n"
84 " done with the environment variable NANOBENCH_ENDLESS. E.g. like so:\n"
86 " NANOBENCH_ENDLESS=MuHash ./bench_bitcoin -filter=MuHash\n"
88 " In rare cases it can be useful to suppress stability warnings. This can be\n"
89 " done with the environment variable NANOBENCH_SUPPRESS_WARNINGS, e.g:\n"
91 " NANOBENCH_SUPPRESS_WARNINGS=1 ./bench_bitcoin\n"
96 " https://github.com/psf/pyperf\n"
98 " 2. CPU pinning & isolation\n"
99 " https://pyperf.readthedocs.io/en/latest/system.html\n"
102 " https://github.com/martinus/nanobench\n"
bool GetBoolArg(const std::string &strArg, bool fDefault) const
Return boolean argument or default value.
std::string GetHelpMessage() const
Get the help string.
@ ALLOW_ANY
disable validation
@ DISALLOW_NEGATION
disallow -nofoo syntax
static std::vector< double > parseAsymptote(const std::string &str)
static void RunAll(const Args &args)
static const char * DEFAULT_BENCH_FILTER
bool HelpRequested(const ArgsManager &args)
void SetupHelpOptions(ArgsManager &args)
Add help options to the args manager.
std::string SHA256AutoDetect()
Autodetect the best available SHA256 implementation.
static constexpr int64_t DEFAULT_MIN_TIME_MS
static void SetupBenchArgs(ArgsManager &argsman)
void AddArg(const std::string &name, const std::string &help, unsigned int flags, const OptionsCategory &cat)
Add argument.
std::string GetArg(const std::string &strArg, const std::string &strDefault) const
Return string argument or default value.
static path PathFromString(const std::string &string)
Convert byte string to path object.
bool ParseParameters(int argc, const char *const argv[], std::string &error)
bool error(const char *fmt, const Args &... args)
int64_t GetIntArg(const std::string &strArg, int64_t nDefault) const
Return integer argument or default value.
int main(int argc, char **argv)