3 ms·
Late to the party, some actual benchmarks using an older CPU with AES-NI: Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz bugs : cpu_meltdown spectre_v1 spectre_v2
by DrJosiah 8y ago
Late to the party, some actual benchmarks using an older CPU with AES-NI:
Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf
Kernel 4.18.14
GCC 7.3.0
Short version, it's ~2x as fast as anything else on my machine for data > 4k, maybe down to 1k, all the way up to > cache (where various other algorithms also max out memory bandwidth). Other non-cryptographic hashes (for comparison) on my local machine: xxHash64 -> ~13G/s, Metrohash128 -> ~13G/s, Metrohash128_crc -> ~18G/s, t1ha_crc -> ~17.5G/s, etc., but Meow doesn't break the 1G/s barrier until 64-96 bytes (the others mentioned reach that speed at 8 bytes).
So yeah, faster for longer keys due to the fast aes mixing + parallel pipeline usage, but slower for shorter keys due to the final mixing dependency at the end.
Using a hacked-up version of Smhasher for wider range of hashing sizes (cache on this CPU is 20 megs):
--- Testing Meow1_64 "parallel aes internals"
[[[ Speed Tests ]]]
Bulk speed test - 67108864-byte keys
Average - 4.556 bytes/cycle - 14337.09 MiB/sec @ 3 ghz
Bulk speed test - 16777216-byte keys
Average - 7.882 bytes/cycle - 24805.52 MiB/sec @ 3 ghz
Bulk speed test - 4194304-byte keys
Average - 9.813 bytes/cycle - 30884.30 MiB/sec @ 3 ghz
Bulk speed test - 1048576-byte keys
Average - 9.657 bytes/cycle - 30390.48 MiB/sec @ 3 ghz
Bulk speed test - 262144-byte keys
Average - 10.642 bytes/cycle - 33490.19 MiB/sec @ 3 ghz
Bulk speed test - 65536-byte keys
Average - 11.871 bytes/cycle - 37360.76 MiB/sec @ 3 ghz
Bulk speed test - 16384-byte keys
Average - 11.336 bytes/cycle - 35675.98 MiB/sec @ 3 ghz
Bulk speed test - 4096-byte keys
Average - 8.241 bytes/cycle - 25936.55 MiB/sec @ 3 ghz
Bulk speed test - 1024-byte keys
Average - 4.056 bytes/cycle - 12765.26 MiB/sec @ 3 ghz