As an Amazon Associate I earn from qualifying purchases @AMAZON
2021 MacBook Pro M1 Max: SHA512 Hashing Speed
Related: 2019 iMac 5K, 2019 Mac Pro, 2020 iMac 5K, 4K and 5K display, Apple MacBook Pro M1, Apple Silicon, iMac, iMac 5K, laptop, Mac Pro, MacBook, MacBook Pro, Macs, video
Please buy your gear at B&H Photo and OWC/MacSales.com using any link from this site.
Unsure which Mac to get or how to configure it? Consult with Lloyd, and see recommended Macs for photographers and videographers.
MPG tested the Apple 16.2" MacBook Pro with M1 Max Chip Z14X000HR, a maxed-out model in all ways except 4TB SSD instead of the maximum 8TB SSD.
This test assess raw hashing power (SHA-512) for 1..N CPU cores, the hash that IntegrityChecker Java uses.
Intel-based Macs have dedicated instruction support for fast hashing, and the Java Virtual Machine gives those instructions lots of love with native code support.
But on Apple Silicon, there appears to be no special instruction support, and there is no love at all for it if so—no native code.
UPDATE, June 2023: JDK 21 brings a 4X speed improvement to SHA512 hashing so that M1/M2 chips are now roughly double the speed of Intel chips.
Intel Macs do great.
The 2021 Macbook Pro M1 Max is relatively poor hashing via Java, taking 6 CPU cores to beat a wheezing 6-year-old 2015 MacBook Pro 4-core. That can be blamed on a JVM that while native for Apple Silicon, is non-optimized for hashing
But it’s not just Java—see the next graph for openssl.
openssl sha512 256GiB_file
The openssl command line is single-threaded native code on each platform. Tests above show that the Intel platforms can approach 800MB/sec for SHA512 hashing from Java code!
Yet openssl is limited to about 500MB/sec on all three platforms, suggesting that it is being throttled by its I/O implementation. It likely uses too-small buffers to allow full speed, thus throttling speed to a low level. Or (very likely) simply failing to overlap I/O with computation, a read-then-hash-repeat serialized approach circa 1980.
Short of compiling a program using Apple’s crypto kit, it is unclear what native hash speed potential on Apple Silicon exists.
Incidentally, the shasum command (a perl script using a crypto library eg "shasum -a 512") is a poor performer, doing only 393MB/sec on the 2019 iMac 5K, far slower than openssl. And only about 281MB/sec on the MBP M1 Max—very poor.