16
16
static constexpr size_t NUM_SOURCES = 64 ;
17
17
static constexpr size_t NUM_ADDRESSES_PER_SOURCE = 256 ;
18
18
19
+ static const std::vector<bool > EMPTY_ASMAP;
20
+ static constexpr uint32_t ADDRMAN_CONSISTENCY_CHECK_RATIO{0 };
21
+
19
22
static std::vector<CAddress> g_sources;
20
23
static std::vector<std::vector<CAddress>> g_addresses;
21
24
@@ -74,14 +77,14 @@ static void AddrManAdd(benchmark::Bench& bench)
74
77
CreateAddresses ();
75
78
76
79
bench.run ([&] {
77
- AddrMan addrman{/* asmap */ std::vector< bool >() , /* deterministic */ false , /* consistency_check_ratio */ 0 };
80
+ AddrMan addrman{EMPTY_ASMAP , /* deterministic= */ false , ADDRMAN_CONSISTENCY_CHECK_RATIO };
78
81
AddAddressesToAddrMan (addrman);
79
82
});
80
83
}
81
84
82
85
static void AddrManSelect (benchmark::Bench& bench)
83
86
{
84
- AddrMan addrman ( /* asmap */ std::vector< bool >() , /* deterministic */ false , /* consistency_check_ratio */ 0 ) ;
87
+ AddrMan addrman{EMPTY_ASMAP , /* deterministic= */ false , ADDRMAN_CONSISTENCY_CHECK_RATIO} ;
85
88
86
89
FillAddrMan (addrman);
87
90
@@ -93,7 +96,7 @@ static void AddrManSelect(benchmark::Bench& bench)
93
96
94
97
static void AddrManGetAddr (benchmark::Bench& bench)
95
98
{
96
- AddrMan addrman ( /* asmap */ std::vector< bool >() , /* deterministic */ false , /* consistency_check_ratio */ 0 ) ;
99
+ AddrMan addrman{EMPTY_ASMAP , /* deterministic= */ false , ADDRMAN_CONSISTENCY_CHECK_RATIO} ;
97
100
98
101
FillAddrMan (addrman);
99
102
@@ -122,7 +125,7 @@ static void AddrManAddThenGood(benchmark::Bench& bench)
122
125
//
123
126
// This has some overhead (exactly the result of AddrManAdd benchmark), but that overhead is constant so improvements in
124
127
// AddrMan::Good() will still be noticeable.
125
- AddrMan addrman ( /* asmap */ std::vector< bool >() , /* deterministic */ false , /* consistency_check_ratio */ 0 ) ;
128
+ AddrMan addrman{EMPTY_ASMAP , /* deterministic= */ false , ADDRMAN_CONSISTENCY_CHECK_RATIO} ;
126
129
AddAddressesToAddrMan (addrman);
127
130
128
131
markSomeAsGood (addrman);
0 commit comments