From 34ef695a8165f1a8394747250a5dc6886c9f91f0 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Mon, 7 Oct 2019 18:23:52 +0200 Subject: [PATCH] btrfs-progs: add BLAKE2 to hash-speedtest Sample results, Intel(R) Xeon(R) CPU E5-1620 v3 @ 3.50GHz Block size: 4096 Iterations: 1000000 NULL-NOP: cycles: 314296257, c/i 314 NULL-MEMCPY: cycles: 582807266, c/i 582 CRC32C: cycles: 1738544130, c/i 1738 XXHASH: cycles: 1449519934, c/i 1449 SHA256: cycles: 110648340548, c/i 110648 BLAKE2b: cycles: 29743769472, c/i 29743 Note this is unoptimized reference implementation. Signed-off-by: David Sterba --- crypto/hash-speedtest.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crypto/hash-speedtest.c b/crypto/hash-speedtest.c index 1425946c..9ad9f403 100644 --- a/crypto/hash-speedtest.c +++ b/crypto/hash-speedtest.c @@ -2,6 +2,7 @@ #include "crypto/hash.h" #include "crypto/crc32c.h" #include "crypto/sha.h" +#include "crypto/blake2.h" #ifndef __x86_64__ #error "Only x86_64 supported" @@ -62,6 +63,7 @@ int main(int argc, char **argv) { { .name = "CRC32C", .digest = hash_crc32c, .digest_size = 4 }, { .name = "XXHASH", .digest = hash_xxhash, .digest_size = 8 }, { .name = "SHA256", .digest = hash_sha256, .digest_size = 32 }, + { .name = "BLAKE2b", .digest = hash_blake2b, .digest_size = 32 }, }; if (argc > 1) {