mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-11 23:30:05 +02:00
Merge bitcoin/bitcoin#24784: refactor: deduplicate integer serialization in RollingBloom benchmark
fff91418ffrefactor: Remove deduplication of data in rollingbloom bench (phyBrackets) Pull request description: Fixed up #24088. ACKs for top commit: vincenzopalazzo: ACKfff91418ffTree-SHA512: 9fef617bceb74a1aec4f4a1e7c4732c4764af3e8ac2fc02b84ce370e8b97431957ca17ee8f44fb96765f7304f8d7e5bfb951440db98ba40f240612f2232d215e
This commit is contained in:
@@ -5,6 +5,9 @@
|
|||||||
|
|
||||||
#include <bench/bench.h>
|
#include <bench/bench.h>
|
||||||
#include <common/bloom.h>
|
#include <common/bloom.h>
|
||||||
|
#include <crypto/common.h>
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
static void RollingBloom(benchmark::Bench& bench)
|
static void RollingBloom(benchmark::Bench& bench)
|
||||||
{
|
{
|
||||||
@@ -13,16 +16,10 @@ static void RollingBloom(benchmark::Bench& bench)
|
|||||||
uint32_t count = 0;
|
uint32_t count = 0;
|
||||||
bench.run([&] {
|
bench.run([&] {
|
||||||
count++;
|
count++;
|
||||||
data[0] = count & 0xFF;
|
WriteLE32(data.data(), count);
|
||||||
data[1] = (count >> 8) & 0xFF;
|
|
||||||
data[2] = (count >> 16) & 0xFF;
|
|
||||||
data[3] = (count >> 24) & 0xFF;
|
|
||||||
filter.insert(data);
|
filter.insert(data);
|
||||||
|
|
||||||
data[0] = (count >> 24) & 0xFF;
|
WriteBE32(data.data(), count);
|
||||||
data[1] = (count >> 16) & 0xFF;
|
|
||||||
data[2] = (count >> 8) & 0xFF;
|
|
||||||
data[3] = count & 0xFF;
|
|
||||||
filter.contains(data);
|
filter.contains(data);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user