diff options
author | MarcoFalke <falke.marco@gmail.com> | 2022-04-07 11:53:16 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2022-04-07 11:53:20 +0200 |
commit | 323d4c09c090a0c74b2fbedfb2cd575f1dd839f3 (patch) | |
tree | 8041a6bfb2718452d36c776119db2d84f52e1f1b | |
parent | 5c80d9b72d6b15b172d004ee4be94569d410cdab (diff) | |
parent | fff91418ffa4911f7262e824418af664b25d4026 (diff) |
Merge bitcoin/bitcoin#24784: refactor: deduplicate integer serialization in RollingBloom benchmark
fff91418ffa4911f7262e824418af664b25d4026 refactor: Remove deduplication of data in rollingbloom bench (phyBrackets)
Pull request description:
Fixed up #24088.
ACKs for top commit:
vincenzopalazzo:
ACK https://github.com/bitcoin/bitcoin/pull/24784/commits/fff91418ffa4911f7262e824418af664b25d4026
Tree-SHA512: 9fef617bceb74a1aec4f4a1e7c4732c4764af3e8ac2fc02b84ce370e8b97431957ca17ee8f44fb96765f7304f8d7e5bfb951440db98ba40f240612f2232d215e
-rw-r--r-- | src/bench/rollingbloom.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/bench/rollingbloom.cpp b/src/bench/rollingbloom.cpp index 9f1679aa84..8f05e3bad0 100644 --- a/src/bench/rollingbloom.cpp +++ b/src/bench/rollingbloom.cpp @@ -5,6 +5,9 @@ #include <bench/bench.h> #include <common/bloom.h> +#include <crypto/common.h> + +#include <vector> static void RollingBloom(benchmark::Bench& bench) { @@ -13,16 +16,10 @@ static void RollingBloom(benchmark::Bench& bench) uint32_t count = 0; bench.run([&] { count++; - data[0] = count & 0xFF; - data[1] = (count >> 8) & 0xFF; - data[2] = (count >> 16) & 0xFF; - data[3] = (count >> 24) & 0xFF; + WriteLE32(data.data(), count); filter.insert(data); - data[0] = (count >> 24) & 0xFF; - data[1] = (count >> 16) & 0xFF; - data[2] = (count >> 8) & 0xFF; - data[3] = count & 0xFF; + WriteBE32(data.data(), count); filter.contains(data); }); } |