mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-15 18:10:26 +01:00
random bench refactor: move to new bench/random.cpp
This commit is contained in:
@@ -49,6 +49,7 @@ bench_bench_bitcoin_SOURCES = \
|
||||
bench/poly1305.cpp \
|
||||
bench/pool.cpp \
|
||||
bench/prevector.cpp \
|
||||
bench/random.cpp \
|
||||
bench/readblock.cpp \
|
||||
bench/rollingbloom.cpp \
|
||||
bench/rpc_blockchain.cpp \
|
||||
|
||||
@@ -196,22 +196,6 @@ static void SipHash_32b(benchmark::Bench& bench)
|
||||
});
|
||||
}
|
||||
|
||||
static void FastRandom_32bit(benchmark::Bench& bench)
|
||||
{
|
||||
FastRandomContext rng(true);
|
||||
bench.run([&] {
|
||||
rng.rand32();
|
||||
});
|
||||
}
|
||||
|
||||
static void FastRandom_1bit(benchmark::Bench& bench)
|
||||
{
|
||||
FastRandomContext rng(true);
|
||||
bench.run([&] {
|
||||
rng.randbool();
|
||||
});
|
||||
}
|
||||
|
||||
static void MuHash(benchmark::Bench& bench)
|
||||
{
|
||||
MuHash3072 acc;
|
||||
@@ -274,8 +258,6 @@ BENCHMARK(SHA256D64_1024_STANDARD, benchmark::PriorityLevel::HIGH);
|
||||
BENCHMARK(SHA256D64_1024_SSE4, benchmark::PriorityLevel::HIGH);
|
||||
BENCHMARK(SHA256D64_1024_AVX2, benchmark::PriorityLevel::HIGH);
|
||||
BENCHMARK(SHA256D64_1024_SHANI, benchmark::PriorityLevel::HIGH);
|
||||
BENCHMARK(FastRandom_32bit, benchmark::PriorityLevel::HIGH);
|
||||
BENCHMARK(FastRandom_1bit, benchmark::PriorityLevel::HIGH);
|
||||
|
||||
BENCHMARK(MuHash, benchmark::PriorityLevel::HIGH);
|
||||
BENCHMARK(MuHashMul, benchmark::PriorityLevel::HIGH);
|
||||
|
||||
25
src/bench/random.cpp
Normal file
25
src/bench/random.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
// Copyright (c) The Bitcoin Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <bench/bench.h>
|
||||
#include <random.h>
|
||||
|
||||
static void FastRandom_32bit(benchmark::Bench& bench)
|
||||
{
|
||||
FastRandomContext rng(true);
|
||||
bench.run([&] {
|
||||
rng.rand32();
|
||||
});
|
||||
}
|
||||
|
||||
static void FastRandom_1bit(benchmark::Bench& bench)
|
||||
{
|
||||
FastRandomContext rng(true);
|
||||
bench.run([&] {
|
||||
rng.randbool();
|
||||
});
|
||||
}
|
||||
|
||||
BENCHMARK(FastRandom_32bit, benchmark::PriorityLevel::HIGH);
|
||||
BENCHMARK(FastRandom_1bit, benchmark::PriorityLevel::HIGH);
|
||||
Reference in New Issue
Block a user