|
4 | 4 |
|
5 | 5 | #include <bench/bench.h>
|
6 | 6 |
|
| 7 | +#include <clientversion.h> |
7 | 8 | #include <crypto/sha256.h>
|
8 | 9 | #include <util/strencodings.h>
|
9 | 10 | #include <util/system.h>
|
@@ -50,7 +51,51 @@ int main(int argc, char** argv)
|
50 | 51 | }
|
51 | 52 |
|
52 | 53 | if (HelpRequested(argsman)) {
|
53 |
| - std::cout << argsman.GetHelpMessage(); |
| 54 | + std::cout << "Usage: bench_bitcoin [options]\n" |
| 55 | + "\n" |
| 56 | + << argsman.GetHelpMessage() |
| 57 | + << "Description:\n" |
| 58 | + "\n" |
| 59 | + " bench_bitcoin executes microbenchmarks. The quality of the benchmark results\n" |
| 60 | + " highly depend on the stability of the machine. It can sometimes be difficult\n" |
| 61 | + " to get stable, repeatable results, so here are a few tips:\n" |
| 62 | + "\n" |
| 63 | + " * Use pyperf [1] to disable frequency scaling, turbo boost etc. For best\n" |
| 64 | + " results, use CPU pinning and CPU isolation (see [2]).\n" |
| 65 | + "\n" |
| 66 | + " * Each call of run() should do exactly the same work. E.g. inserting into\n" |
| 67 | + " a std::vector doesn't do that as it will reallocate on certain calls. Make\n" |
| 68 | + " sure each run has exactly the same preconditions.\n" |
| 69 | + "\n" |
| 70 | + " * If results are still not reliable, increase runtime with e.g.\n" |
| 71 | + " -min_time=5000 to let a benchmark run for at least 5 seconds.\n" |
| 72 | + "\n" |
| 73 | + " * bench_bitcoin uses nanobench [3] for which there is extensive\n" |
| 74 | + " documentation available online.\n" |
| 75 | + "\n" |
| 76 | + "Environment Variables:\n" |
| 77 | + "\n" |
| 78 | + " To attach a profiler you can run a benchmark in endless mode. This can be\n" |
| 79 | + " done with the environment variable NANOBENCH_ENDLESS. E.g. like so:\n" |
| 80 | + "\n" |
| 81 | + " NANOBENCH_ENDLESS=MuHash ./bench_bitcoin -filter=MuHash\n" |
| 82 | + "\n" |
| 83 | + " In rare cases it can be useful to suppress stability warnings. This can be\n" |
| 84 | + " done with the environment variable NANOBENCH_SUPPRESS_WARNINGS, e.g:\n" |
| 85 | + "\n" |
| 86 | + " NANOBENCH_SUPPRESS_WARNINGS=1 ./bench_bitcoin\n" |
| 87 | + "\n" |
| 88 | + "Notes:\n" |
| 89 | + "\n" |
| 90 | + " 1. pyperf\n" |
| 91 | + " https://github.com/psf/pyperf\n" |
| 92 | + "\n" |
| 93 | + " 2. CPU pinning & isolation\n" |
| 94 | + " https://pyperf.readthedocs.io/en/latest/system.html\n" |
| 95 | + "\n" |
| 96 | + " 3. nanobench\n" |
| 97 | + " https://github.com/martinus/nanobench\n" |
| 98 | + "\n"; |
54 | 99 |
|
55 | 100 | return EXIT_SUCCESS;
|
56 | 101 | }
|
|
0 commit comments