4 ms·
So it basically excels at everything but cryptography where it's terrible in comparison. I found this a little interesting because it should have custom hardwar
by jug 6y ago
So it basically excels at everything but cryptography where it's terrible in comparison. I found this a little interesting because it should have custom hardware specifically for this (i.e. an AES engine which is what's being benchmarked here), formerly in the separate Apple T2 security chip? I wonder if this test simply doesn't use that hardware (lack of support in Go libs?) or that it does but it really is this much worse. (or a third option -- there is support but the T2 doesn't accelerate many of the features tested and it's more special purpose for only specific calls from macOS)
- riobard 6y agoIt explains why at the second paragraph. > A top level takeaway from this data is that for things that rely on pure Go the M1 machine is, in general, a good bit faster than the Intel machine. For code that relies on highly optimized assembly, like a good chunk of the crypto/ code, the Intel machine wins (although I wouldn’t be surprised to see significant gains for the M1 as arm64 assembly implementations get more attention and are further polished). Basically Go lacks lots of optimized assembly code for ARM64.
- zingermc 6y agoThere does appear to be ARM64 assembly in Go's crypto code, but perhaps it's suboptimal for M1. Or perhaps there's a build config issue, and the assembly isn't being used. Just my speculation, though. I haven't looked into it. https://github.com/golang/go/blob/master/src/crypto/aes/asm_arm64.s https://github.com/golang/go/blob/master/src/crypto/aes/asm_...
- willvarfar 6y agoAs the article says, the crypto on x86 is hand-optimized assembly, whereas the M1 is running the fallback C. In other benchmarks like geekbench, which are not benchmarking golang's libs, the M1 is massively stronger than Intel on e.g. AES-XTS. https://www.extremetech.com/computing/317304-benchmark-results-show-apple-m1-beating-every-intel-powered-macbook-pro https://www.extremetech.com/computing/317304-benchmark-resul... So hopefully the M1 gets the same hand-optimizing effort that x86 historically got.
- Ar-Curunir 6y agoI think it’s just testing whether the backend is assembly or not; pure Go impls are faster, for example: https://twitter.com/FiloSottile/status/1328886085318021120 https://twitter.com/FiloSottile/status/1328886085318021120
- mike_d 6y agox86 has AES implemented as native instructions (AES-NI). ARM devices normally add a crypto accelerator chip if they need it. Apple's T2 secure enclave provides exactly this. Go libs just need to be tweaked to use the correct chip to do the work. Looks like they did do AES-XTS on the main die because it is required for encrypted storage.