aboutsummaryrefslogtreecommitdiff
path: root/src/bench
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2017-09-26 18:29:42 -0700
committerPieter Wuille <pieter.wuille@gmail.com>2018-05-29 14:05:00 -0700
commitd0c96328833127284574bfef26f96aa2e4afc91a (patch)
tree8eb834544a3b6611ce5de339f9b0fc2974536189 /src/bench
parent57f34630fb6c3e218bd19535ac607008cb894173 (diff)
Specialized double sha256 for 64 byte inputs
Diffstat (limited to 'src/bench')
-rw-r--r--src/bench/crypto_hash.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/bench/crypto_hash.cpp b/src/bench/crypto_hash.cpp
index adb69bc6c3..7d907eaf10 100644
--- a/src/bench/crypto_hash.cpp
+++ b/src/bench/crypto_hash.cpp
@@ -52,6 +52,14 @@ static void SHA256_32b(benchmark::State& state)
}
}
+static void SHA256D64_1024(benchmark::State& state)
+{
+ std::vector<uint8_t> in(64 * 1024, 0);
+ while (state.KeepRunning()) {
+ SHA256D64(in.data(), in.data(), 1024);
+ }
+}
+
static void SHA512(benchmark::State& state)
{
uint8_t hash[CSHA512::OUTPUT_SIZE];
@@ -94,5 +102,6 @@ BENCHMARK(SHA512, 330);
BENCHMARK(SHA256_32b, 4700 * 1000);
BENCHMARK(SipHash_32b, 40 * 1000 * 1000);
+BENCHMARK(SHA256D64_1024, 7400);
BENCHMARK(FastRandom_32bit, 110 * 1000 * 1000);
BENCHMARK(FastRandom_1bit, 440 * 1000 * 1000);