Digging into an unexpected encryption speed boost
What follows is a lengthy dive into a semi-recent massive performance improvement in openssl speeds in macOS. As it's long, here's a tl;dr version:
- From 10.14.4 to 10.14.5, a change in macOS improved openssl speed benchmark results anywhere from 15x to 30x.
- In real world use, encryption of a large sample file (570MB) using a very long password happened nearly twice as quickly as it did before the update.
- The version number for openssl (which is really LibreSSL) is the same (2.6.5) in both 10.14.4 and 10.14.5. I also confirmed that the packages, as loaded on the Apple Open Source site, are identical.
- The four libraries that openssl links to have the same version numbers in 10.14.4 and 10.14.5.
- The binaries for openssl and the four linked libraries all use much less disk space in 10.14.5 than they did in 10.14.4. I can't explain this, except that openssl itself is no longer a universal binary.
- I believe the performance boost is due to macOS enabling Intel's AES-NI, which allow hardware acceleration of some key cryptography tasks. But I can't figure out how this change was made, given the above data.
- The Apple Open Source site may hold the answers, but that work is beyond my skill level.
Keep reading if you'd like to see how I came to the above summary…