Open tsv1991 opened 1 year ago
@tsv1991, you are not using the best part of multi-buffer hashing; hashing multiple independent jobs at one time. Disregarding file I/O time, you might be able to do 10-12 hashes in the time a single buffer hashing can do one. By just doing summit() followed immediately by flush() you loose any advantage of doing more than one job at a time. You do have to have independent hash jobs around as there is no way to split up a single hash block into independently calculated chunks.
@gbtucker should the hash calculated using multi-buffer hashing and the classic approach be the same? I couldn't get a hash to be the same.
I created a file with 1GB size.
fallocate -l 1G bench.dat
And made 3 test program. Python with hashlib:
C with openssl/sha.h:
And C with sha256_mb.h (isa-l_crypto):
And I was very surprised when saw that time of hashing with isa-l_crypto was bigger. What could be the problem?
I was looking at this code https://github.com/01org/isa-l_crypto/blob/master/sha256_mb/sha256_mb_test.c and https://github.com/intel/isa-l_crypto/issues/3
Also I try use this example and got same time of hashing: