erthink / t1ha

One of the fastest hash functions
https://www.ptsecurity.com
Other
345 stars 31 forks source link

PERFORMANCE COMPARISON (this is not a bug or an issue) #24

Closed erthink closed 6 years ago

erthink commented 6 years ago

Please note: the benchmarking results depend on the processor and compiler model.

...
model       : 158
model name  : Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
stepping    : 9
microcode   : 0x8e

clang version 6.0.1 (tags/RELEASE_601/final)

Preparing to benchmarking...
 - suggest enable rdpmc for usermode (echo 2 | sudo tee /sys/devices/cpu/rdpmc)
 - running on CPU#4
 - use RDPMC_perf as clock source for benchmarking
 - assume it cheap and stable
 - measure granularity and overhead: 53 cycle, 0.0188679 iteration/cycle

Bench for tiny keys (7 bytes):
t1ha2_atonce            :     12.117 cycle/hash,  1.731 cycle/byte,  0.578 byte/cycle,  1.733 Gb/s @3GHz 
t1ha2_atonce128*        :     29.656 cycle/hash,  4.237 cycle/byte,  0.236 byte/cycle,  0.708 Gb/s @3GHz 
t1ha2_stream*           :     77.625 cycle/hash, 11.089 cycle/byte,  0.090 byte/cycle,  0.271 Gb/s @3GHz 
t1ha2_stream128*        :     97.625 cycle/hash, 13.946 cycle/byte,  0.072 byte/cycle,  0.215 Gb/s @3GHz 
t1ha1_64le              :     12.219 cycle/hash,  1.746 cycle/byte,  0.573 byte/cycle,  1.719 Gb/s @3GHz 
t1ha0                   :     14.070 cycle/hash,  2.010 cycle/byte,  0.498 byte/cycle,  1.493 Gb/s @3GHz 
xxhash64                :     21.234 cycle/hash,  3.033 cycle/byte,  0.330 byte/cycle,  0.989 Gb/s @3GHz 
StadtX                  :     20.219 cycle/hash,  2.888 cycle/byte,  0.346 byte/cycle,  1.039 Gb/s @3GHz 
HighwayHash64_portable  :    504.750 cycle/hash, 72.107 cycle/byte,  0.014 byte/cycle,  0.042 Gb/s @3GHz 
HighwayHash64_sse41     :     81.938 cycle/hash, 11.705 cycle/byte,  0.085 byte/cycle,  0.256 Gb/s @3GHz 
HighwayHash64_avx2      :     51.812 cycle/hash,  7.402 cycle/byte,  0.135 byte/cycle,  0.405 Gb/s @3GHz 

gcc version 8.1.1 20180712 (Red Hat 8.1.1-5) (GCC)

Preparing to benchmarking...
 - suggest enable rdpmc for usermode (echo 2 | sudo tee /sys/devices/cpu/rdpmc)
 - running on CPU#2
 - use RDPMC_perf as clock source for benchmarking
 - assume it cheap and stable
 - measure granularity and overhead: 54 cycle, 0.0185185 iteration/cycle

...

Bench for large keys (16384 bytes):
t1ha2_atonce            :   3461.000 cycle/hash,  0.211 cycle/byte,  4.734 byte/cycle, 14.202 Gb/s @3GHz 
t1ha2_atonce128*        :   3438.000 cycle/hash,  0.210 cycle/byte,  4.766 byte/cycle, 14.297 Gb/s @3GHz 
t1ha2_stream*           :   3471.000 cycle/hash,  0.212 cycle/byte,  4.720 byte/cycle, 14.161 Gb/s @3GHz 
t1ha2_stream128*        :   3484.000 cycle/hash,  0.213 cycle/byte,  4.703 byte/cycle, 14.108 Gb/s @3GHz 
t1ha1_64le              :   3431.000 cycle/hash,  0.209 cycle/byte,  4.775 byte/cycle, 14.326 Gb/s @3GHz 
t1ha0                   :   1187.000 cycle/hash,  0.072 cycle/byte, 13.803 byte/cycle, 41.409 Gb/s @3GHz 
xxhash64                :   4120.000 cycle/hash,  0.251 cycle/byte,  3.977 byte/cycle, 11.930 Gb/s @3GHz 
StadtX                  :   3501.000 cycle/hash,  0.214 cycle/byte,  4.680 byte/cycle, 14.039 Gb/s @3GHz 
HighwayHash64_portable  :  41965.000 cycle/hash,  2.561 cycle/byte,  0.390 byte/cycle,  1.171 Gb/s @3GHz 
HighwayHash64_sse41     :   6222.000 cycle/hash,  0.380 cycle/byte,  2.633 byte/cycle,  7.900 Gb/s @3GHz 
HighwayHash64_avx2      :   4601.000 cycle/hash,  0.281 cycle/byte,  3.561 byte/cycle, 10.683 Gb/s @3GHz 
Sanmayce commented 6 years ago

Leonid your work ... thrashes the ... hashers. Congratulations!

[...]

erthink commented 6 years ago

@Sanmayce, I trimmed your comment because of information that not looks useful but unrelated to the t1ha. Please don't be offended by this.

To support the Intel compiler (icl) I made some minor adjustments by the https://github.com/leo-yuriev/t1ha/commit/20bdd33beb21ecff63bc96df910c8fdbb5d69b12. The rest you should do yourself or contact Intel support.

To compare the quality and speed of hash functions, I recommend using SMHasher. For links please refer to the README.md.

Regards.

Sanmayce commented 6 years ago

I trimmed your comment because of information that not looks useful but unrelated to the t1ha. Please don't be offended by this.

Not offended but disappointed, therefore will trim it even further for you.