Skip to content

Commit 323d4c0

Browse files
author
MarcoFalke
committed
Merge bitcoin/bitcoin#24784: refactor: deduplicate integer serialization in RollingBloom benchmark
fff9141 refactor: Remove deduplication of data in rollingbloom bench (phyBrackets) Pull request description: Fixed up #24088. ACKs for top commit: vincenzopalazzo: ACK bitcoin/bitcoin@fff9141 Tree-SHA512: 9fef617bceb74a1aec4f4a1e7c4732c4764af3e8ac2fc02b84ce370e8b97431957ca17ee8f44fb96765f7304f8d7e5bfb951440db98ba40f240612f2232d215e
2 parents 5c80d9b + fff9141 commit 323d4c0

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/bench/rollingbloom.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55

66
#include <bench/bench.h>
77
#include <common/bloom.h>
8+
#include <crypto/common.h>
9+
10+
#include <vector>
811

912
static void RollingBloom(benchmark::Bench& bench)
1013
{
@@ -13,16 +16,10 @@ static void RollingBloom(benchmark::Bench& bench)
1316
uint32_t count = 0;
1417
bench.run([&] {
1518
count++;
16-
data[0] = count & 0xFF;
17-
data[1] = (count >> 8) & 0xFF;
18-
data[2] = (count >> 16) & 0xFF;
19-
data[3] = (count >> 24) & 0xFF;
19+
WriteLE32(data.data(), count);
2020
filter.insert(data);
2121

22-
data[0] = (count >> 24) & 0xFF;
23-
data[1] = (count >> 16) & 0xFF;
24-
data[2] = (count >> 8) & 0xFF;
25-
data[3] = count & 0xFF;
22+
WriteBE32(data.data(), count);
2623
filter.contains(data);
2724
});
2825
}

0 commit comments

Comments
 (0)