Performance on arm
Hey,I've been looking at seahash as a replacement for siphash in a project and I've come across a strange difference in performance on arm compared to intel.
I've tested hashing a number of different files with different sizes and the trend is that on my intel chip I see that seahash is generally faster than siphash by a factor of ~1.5x. This is on a 2ghz skylake mobile chip running macos.
jon~/D/g/!/r/hash_test:master❯❯❯ ./target/release/hash_test -f Cargo.lock
Hashing "Cargo.lock"
Sip Hash took 1.139µs on average
Sea Hash took 723ns on average
Blake3 took 3.419µs on average
jon~/D/g/!/r/hash_test:master❯❯❯ sysctl -n machdep.cpu.brand_string
Intel(R) Core(TM) i5-6360U CPU @ 2.00GHz
Switching over to an arm chip I see siphash beating out seahash by about 10%. Again this trend was observed hashing a number of different files with differing sizes.
root@odroid:~/rustExperiments/hash_test# ./target/release/hash_test -f Cargo.lock
Hashing "Cargo.lock"
Sip Hash took 2.101µs on average
Sea Hash took 2.34µs on average
Blake3 took 15.11µs on average
root@odroid:~/rustExperiments/hash_test# lscpu
Architecture: aarch64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 1
Core(s) per socket: 4
Socket(s): 1
Vendor ID: ARM
Model: 0
Model name: Cortex-A55
Stepping: r1p0
CPU max MHz: 1908.0000
CPU min MHz: 100.0000
BogoMIPS: 48.00
Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp
In both cases this code has been compiled with rustc 1.45.0.
Anyway, just wanted to report this. I'm not sure if this is down to something in the rust compiler, a difference in simd performance across platforms, or something else entirely.
The (very simple) code I'm using to test is here.