Skip to content

Commit 1fc62c8

Browse files
0bed7b4 Merge bitcoin#22292: bench, doc: benchmarking updates and fixups (fanquake) c95df68 Merge bitcoin#22388: ci: use Ubuntu 20.04 as the default Docker container (MarcoFalke) c586ca5 Merge bitcoin#22334: wallet: do not spam about non-existent spk managers (fanquake) 62f9394 Merge bitcoin#22308: wallet: Add missing BlockUntilSyncedToCurrentChain (MarcoFalke) 240d8ef Merge bitcoin#22358: Remove unused wallet pointer from wallet signals (fanquake) 9a1500a Merge bitcoin#22118: test: check anchors.dat when node starts for the first time (MarcoFalke) 262c8b6 Merge bitcoin#22082: test: update nanobench from release 4.0.0 to 4.3.4 (MarcoFalke) 3d2cea6 Merge bitcoin-core/gui#311: Peers Window rename 'Peer id' to 'Peer' (Hennadii Stepanov) dc498be Merge bitcoin-core/gui#271: Don't clear console prompt when font resizing (W. J. van der Laan) 1ed2d2d Merge bitcoin#21053: rpc, test: document {previous,next}blockhash as optional (MarcoFalke) Pull request description: ## Issue being fixed or feature implemented Regular backports from bitcoin v22 ## What was done? - bitcoin#21053 - bitcoin-core/gui#271 - bitcoin-core/gui#311 - bitcoin#22082 - bitcoin#22118 - bitcoin#22358 - bitcoin#22308 - bitcoin#22334 - bitcoin#22388 - bitcoin#22292 ## How Has This Been Tested? Run unit/functional tests ## Breaking Changes N/A ## Checklist: - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone ACKs for top commit: PastaPastaPasta: utACK 0bed7b4 Tree-SHA512: 8354297857516ddf94b242f2e50e1a28d999e613da2a7eb90c603e1fee7212e46d6e8a20ad42aa2945b48137e98fc7f589c9c77469c71cc01d032a33fa6da517
2 parents 644f00f + 0bed7b4 commit 1fc62c8

File tree

16 files changed

+307
-131
lines changed

16 files changed

+307
-131
lines changed

ci/test/00_setup_env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export RUN_SYMBOL_TESTS=${RUN_SYMBOL_TESTS:-false}
5050
export EXPECTED_TESTS_DURATION_IN_SECONDS=${EXPECTED_TESTS_DURATION_IN_SECONDS:-1000}
5151

5252
export CONTAINER_NAME=${CONTAINER_NAME:-ci_unnamed}
53-
export DOCKER_NAME_TAG=${DOCKER_NAME_TAG:-ubuntu:focal}
53+
export DOCKER_NAME_TAG=${DOCKER_NAME_TAG:-ubuntu:20.04}
5454
# Randomize test order.
5555
# See https://www.boost.org/doc/libs/1_71_0/libs/test/doc/html/boost_test/utf_reference/rt_param_reference/random.html
5656
export BOOST_TEST_RANDOM=${BOOST_TEST_RANDOM:-1}

doc/benchmarking.md

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ thread queue, wallet balance.
88
Running
99
---------------------
1010

11-
For benchmarks purposes you only need to compile `dash_bench`. Beware of configuring without `--enable-debug` as this would impact
12-
benchmarking by unlatching log printers and lock analysis.
11+
For benchmarking, you only need to compile `dash_bench`. The bench runner
12+
warns if you configure with `--enable-debug`, but consider if building without
13+
it will impact the benchmark(s) you are interested in by unlatching log printers
14+
and lock analysis.
1315

1416
make -C src dash_bench
1517

@@ -19,19 +21,28 @@ After compiling Dash Core, the benchmarks can be run with:
1921

2022
The output will look similar to:
2123
```
22-
| ns/byte | byte/s | error % | benchmark
23-
|--------------------:|--------------------:|--------:|:----------------------------------------------
24-
| 64.13 | 15,592,356.01 | 0.1% | `Base58CheckEncode`
25-
| 24.56 | 40,722,672.68 | 0.2% | `Base58Decode`
24+
| ns/op | op/s | err% | total | benchmark
25+
|--------------------:|--------------------:|--------:|----------:|:----------
26+
| 57,927,463.00 | 17.26 | 3.6% | 0.66 | `AddrManAdd`
27+
| 677,816.00 | 1,475.33 | 4.9% | 0.01 | `AddrManGetAddr`
28+
29+
...
30+
31+
| ns/byte | byte/s | err% | total | benchmark
32+
|--------------------:|--------------------:|--------:|----------:|:----------
33+
| 127.32 | 7,854,302.69 | 0.3% | 0.00 | `Base58CheckEncode`
34+
| 31.95 | 31,303,226.99 | 0.2% | 0.00 | `Base58Decode`
35+
2636
...
2737
```
2838

2939
Help
3040
---------------------
3141

32-
src/bench/bench_dash --help
42+
src/bench/bench_dash -?
3343

34-
To print options like scaling factor or per-benchmark filter.
44+
To print the various options, like listing the benchmarks without running them
45+
or using a regex filter to only run certain benchmarks.
3546

3647
Notes
3748
---------------------

src/bench/bench.h

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,19 @@
1818
/*
1919
* Usage:
2020
21-
static void CODE_TO_TIME(benchmark::Bench& bench)
21+
static void NameOfYourBenchmarkFunction(benchmark::Bench& bench)
2222
{
23-
... do any setup needed...
24-
nanobench::Config().run([&] {
25-
... do stuff you want to time...
23+
...do any setup needed...
24+
25+
bench.run([&] {
26+
...do stuff you want to time; refer to src/bench/nanobench.h
27+
for more information and the options that can be passed here...
2628
});
27-
... do any cleanup needed...
29+
30+
...do any cleanup needed...
2831
}
2932
30-
BENCHMARK(CODE_TO_TIME);
33+
BENCHMARK(NameOfYourBenchmarkFunction);
3134
3235
*/
3336

@@ -55,7 +58,8 @@ class BenchRunner
5558

5659
static void RunAll(const Args& args);
5760
};
58-
}
61+
} // namespace benchmark
62+
5963
// BENCHMARK(foo) expands to: benchmark::BenchRunner bench_11foo("foo", foo);
6064
#define BENCHMARK(n) \
6165
benchmark::BenchRunner PASTE2(bench_, PASTE2(__LINE__, n))(STRINGIZE(n), n);

src/bench/bench_bitcoin.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ static void SetupBenchArgs(ArgsManager& argsman)
1717
{
1818
SetupHelpOptions(argsman);
1919

20-
argsman.AddArg("-list", "List benchmarks without executing them", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
20+
argsman.AddArg("-asymptote=n1,n2,n3,...", "Test asymptotic growth of the runtime of an algorithm, if supported by the benchmark", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
2121
argsman.AddArg("-filter=<regex>", strprintf("Regular expression filter to select benchmark by name (default: %s)", DEFAULT_BENCH_FILTER), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
22-
argsman.AddArg("-asymptote=n1,n2,n3,...", strprintf("Test asymptotic growth of the runtime of an algorithm, if supported by the benchmark"), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
23-
argsman.AddArg("-output_csv=<output.csv>", "Generate CSV file with the most important benchmark results.", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
24-
argsman.AddArg("-output_json=<output.json>", "Generate JSON file with all benchmark results.", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
22+
argsman.AddArg("-list", "List benchmarks without executing them", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
23+
argsman.AddArg("-output_csv=<output.csv>", "Generate CSV file with the most important benchmark results", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
24+
argsman.AddArg("-output_json=<output.json>", "Generate JSON file with all benchmark results", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
2525
}
2626

2727
// parses a comma separated list like "10,20,30,50"

0 commit comments

Comments
 (0)