3 ms·
Another benchmark: time openssl sha256 /tmp/bigfile real 0m28.160s user 0m27.750s sys 0m0.272s time shasum -a 256 /tmp/bigfile real 0m6.146s
by clarkmoody 7y ago
Another benchmark:
time openssl sha256 /tmp/bigfile
real 0m28.160s
user 0m27.750s
sys 0m0.272s
time shasum -a 256 /tmp/bigfile
real 0m6.146s
user 0m5.407s
sys 0m0.560s
time b2sum /tmp/bigfile
real 0m1.732s
user 0m1.450s
sys 0m0.244s
time b3sum /tmp/bigfile
real 0m0.212s
user 0m0.996s
sys 0m0.379s
TIL OpenSSL sha256 invocation is really slow compared to the shasum program. Also BLAKE3 is really fast.
Edit: bigfile is 1GB of /dev/random
- paavoova 7y agoOn my machine running Ubuntu 18.04 (coreutils 8.28, openssl 1.1.1), openssl is faster than both shasum and sha256sum.
- xemdetia 7y agoYeah as someone familiar with openssl it looks like a version of openssl that was built incorrectly.
- harikb 7y agoMay be silly to ask, but can we assume the numbers are from second run for each variant.
- garmaine 7y agoDid you prime the cache before the first run? Or put /temp on a RAM file system?
- pixelbeat__ 7y agoSome notes re coreutils and ssh sha256sum uses 128KiB blocks when reading, which may be more optimized than the openssl program. sha256sum supports using openssl libs as they are generally faster. This is enabled on Red Hat flavored distros and arch, but not debian flavored as yet The upcoming release of sha256sum (8.32) will auto enable use of openssl for >= v 3, as openssl's licence has changed to apache in that version
- sliken 7y agoHere's my similar runs on a E3-1230 v5: b3sum ./1GB 0m0.124s md5sum ./1GB 0m1.620s sha512sum ./1GB 0m2.988s sha256sum ./1GB 0m4.738s I was even more impressed when I timed dd: $ time dd if=./1GB of=/dev/null bs=65536 16384+0 records in 16384+0 records out 1073741824 bytes (1.1 GB, 1.0 GiB) copied, 0.10451 s, 10.3 GB/s real 0m0.107s