3 ms·
Interestingly, sha256sum and openssl don't use sha_ni. iced-cpuid $(which b3sum) AVX AVX2 AVX512F AVX512VL BMI1 CET_IBT CMOV SSE SSE2 SSE4_1 SSSE3 SYSCALL XS
by 0xdeafbeef 3y ago
Interestingly, sha256sum and openssl don't use sha_ni.
iced-cpuid $(which b3sum)
AVX
AVX2
AVX512F
AVX512VL
BMI1
CET_IBT
CMOV
SSE
SSE2
SSE4_1
SSSE3
SYSCALL
XSAVE
iced-cpuid $(which openssl ) CET_IBT
CMOV
SSE
SSE2
iced-cpuid $(which sha256sum)
CET_IBT
CMOV
SSE
SSE2
Also, sha256sum in my case is a bit faster
Benchmark 1: openssl sha256 /tmp/rand_1G
Time (mean ± σ): 540.0 ms ± 1.1 ms [User: 406.2 ms, System: 132.0 ms]
Range (min … max): 538.5 ms … 542.3 ms 10 runs
Benchmark 2: b3sum --num-threads 1 /tmp/rand_1G
Time (mean ± σ): 279.6 ms ± 0.8 ms [User: 213.9 ms, System: 64.4 ms]
Range (min … max): 278.6 ms … 281.1 ms 10 runs
Benchmark 3: sha256sum /tmp/rand_1G
Time (mean ± σ): 509.0 ms ± 6.3 ms [User: 386.4 ms, System: 120.5 ms]
Range (min … max): 504.6 ms … 524.2 ms 10 runs
- vluft 3y agonot sure that tool is correct; on my openssl it shows same output as you have there, but not aes-ni which is definitely enabled and functional. ETA: ahh you want to do that on libcrypto: iced-cpuid <...>/libcrypto.so.3: ADX AES AVX AVX2 AVX512BW AVX512DQ AVX512F AVX512VL AVX512_IFMA BMI1 BMI2 CET_IBT CLFSH CMOV D3NOW MMX MOVBE MSR PCLMULQDQ PREFETCHW RDRAND RDSEED RTM SHA SMM SSE SSE2 SSE3 SSE4_1 SSSE3 SYSCALL TSC VMX XOP XSAVE
- vluft 3y agofurther research suggests that GNU coreutils cksum will use libcrypto in some configurations (though not mine); I expect that both both your commands above are actually using sha-ni