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 <dsterba@suse.com>
master
David Sterba 2019-10-07 18:23:52 +02:00
parent f5e952b13d
commit 34ef695a81
1 changed files with 2 additions and 0 deletions

View File

@ -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) {