rurban / smhasher

Hash function quality and speed tests
https://rurban.github.io/smhasher/
Other
1.85k stars 178 forks source link

PRVHASH 3.2 #179

Closed avaneev closed 3 years ago

avaneev commented 3 years ago

After a lot of effort I've come up with a new version of PRVHASH core function, which is now fully 64-bit, for both input and output. So, existing PRVHASH42 variants can be removed - the new PRVHASH64/PRVHASH64S function replaces them all. 32-bit hashing is now unavailable. Speed was also further increased for PRVHASH64S.

PRNG is now twice as fast. I think security remained the same overall.

@rurban Please send me your PayPal address to aleksey.vaneev@gmail.com - I would like to make a direct donation to you.

https://github.com/avaneev/prvhash

rurban commented 3 years ago

Alex, the github sponsorship is preferred. less fees via stripe. I have no PayPal. There's also my patroen link. Thanks!

avaneev commented 3 years ago

@rurban Please add a $12/mo tier.

avaneev commented 3 years ago

@rurban To GitHub

avaneev commented 3 years ago

Updated to v3.1, implemented a "perfect" hashing finalization solution.

avaneev commented 3 years ago

Version 3.2, additional performance boost.

rurban commented 3 years ago

I'm still busy with others stuff, sorry.

rurban commented 3 years ago

I moved them into a submodule. Much easier to maintain, and small enough. I also don't have worry about dos2unix anymore.

rurban commented 3 years ago

#undef PRVHASH64S_PAR is counter-productive. users need that to init their seeds

avaneev commented 3 years ago

#undef PRVHASH64S_PAR is counter-productive. users need that to init their seeds

Thanks, I'll remove undefs.

avaneev commented 3 years ago

I moved them into a submodule. Much easier to maintain, and small enough. I also don't have worry about dos2unix anymore.

By the way, you may try PRVHASH16 just for fun - it also works for hashing quite well, I've tried it on up to 1024-bit hashes with SMHasher. Passes all tests.

avaneev commented 3 years ago

I've also found an "ideal" core hash function, but it's 20-30% slower. I'll leave it for the future, if PRVHASH ever gets any serious attention. I think my quest is over now, I've reached all goals with this PRNG/hashing system.

rurban commented 3 years ago

Done. Just prvhash16 will be added later eventually

avaneev commented 3 years ago

Thank you. These are mostly expected speed results (I get 4GB/s for PRVHASH64 on Skylake with 4.7GHz boost). However, previous version (42) of PRVHASH performed better in your tests, which is strange. It did not perform as fast on my machines considering you have only 3.1 GHz boost Intel i5-2300. In some tests your computer showed even 8.7GB/s for PRVHASH42S and 3.7GHz for PRVHASH42 previously, which should not be possible at all.

Like I've mentioned before, I think there's some strangeness in your raw speed tests, sorry.

avaneev commented 3 years ago

Also, in your tests on Mac Air i7-4650, both PRVHASH64 and PRVHASH64S have similar speed, which I see as impossibility - PRVHASH64S should be at least 1.5-2 times faster due to much lower overhead.

avaneev commented 3 years ago

Only your Zen results are in tune with what I usually get, maybe some issues with non-AMD timing functions.

avaneev commented 3 years ago

@rurban Ah, I've noticed an issue with speed numbers you've put into table. Your benchmark results show different figures: PRVHASH64 is about 4.2GB/s, PRVHASH64S is about 10GB/s. Also the cycles values are off.