aboutsummaryrefslogtreecommitdiff
path: root/src/bench
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2023-03-27 14:22:37 +0100
committerfanquake <fanquake@gmail.com>2023-03-27 14:34:52 +0100
commit39630675553280fe72254de69ec1ed2bc8fc9808 (patch)
treec65e616e43952456894989de68d6541d6b79a08b /src/bench
parent3e835ca95863b1350a6425dad6e2bc604e01ecdf (diff)
parent03ec5b6f9ca3af28c9ce25cf2393e28ae852d808 (diff)
Merge bitcoin/bitcoin#26642: clang-tidy: Add more `performance-*` checks and related fixes
03ec5b6f9ca3af28c9ce25cf2393e28ae852d808 clang-tidy: Exclude `performance-*` checks rather including them (Hennadii Stepanov) 24004372302adfc0e7cb36f8db6830694bf050e9 clang-tidy: Add `performance-type-promotion-in-math-fn` check (Hennadii Stepanov) 7e975e6cf86617346c1d8e2568f74a0252c03857 clang-tidy: Add `performance-inefficient-vector-operation` check (Hennadii Stepanov) 516b75f66ec3ba7495fc028c750937bd66cc9bba clang-tidy: Add `performance-faster-string-find` check (Hennadii Stepanov) Pull request description: ACKs for top commit: martinus: ACK 03ec5b6f9ca3af28c9ce25cf2393e28ae852d808 TheCharlatan: re-ACK [03ec5b6](https://github.com/bitcoin/bitcoin/pull/26642/commits/03ec5b6f9ca3af28c9ce25cf2393e28ae852d808) Tree-SHA512: 2dfa52f9131da88826f32583bfd534a56a998477db9804b7333c0e7ac0b6b36141009755c7163b9f95d0ecbf5c2cb63f8a69ce4b114bb83423faed21b50cec67
Diffstat (limited to 'src/bench')
-rw-r--r--src/bench/lockedpool.cpp4
-rw-r--r--src/bench/wallet_create_tx.cpp1
2 files changed, 2 insertions, 3 deletions
diff --git a/src/bench/lockedpool.cpp b/src/bench/lockedpool.cpp
index 161f9af621..6851ed0bd8 100644
--- a/src/bench/lockedpool.cpp
+++ b/src/bench/lockedpool.cpp
@@ -17,9 +17,7 @@ static void BenchLockedPool(benchmark::Bench& bench)
const size_t synth_size = 1024*1024;
Arena b(synth_base, synth_size, 16);
- std::vector<void*> addr;
- for (int x=0; x<ASIZE; ++x)
- addr.push_back(nullptr);
+ std::vector<void*> addr{ASIZE, nullptr};
uint32_t s = 0x12345678;
bench.run([&] {
int idx = s & (addr.size() - 1);
diff --git a/src/bench/wallet_create_tx.cpp b/src/bench/wallet_create_tx.cpp
index bd32a5abdc..80d23d1e51 100644
--- a/src/bench/wallet_create_tx.cpp
+++ b/src/bench/wallet_create_tx.cpp
@@ -146,6 +146,7 @@ static void AvailableCoins(benchmark::Bench& bench, const std::vector<OutputType
// Generate destinations
std::vector<CScript> dest_wallet;
+ dest_wallet.reserve(output_type.size());
for (auto type : output_type) {
dest_wallet.emplace_back(GetScriptForDestination(getNewDestination(wallet, type)));
}