-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance comparing against the other twox implementation? #49
Comments
I ran the test for all byte sizes upto 256. Here are the results:
|
Hm, that doesn't look good What is your machine? |
It just occurred to me, if you use optimization then compiler can disregard twox computation at the end as it no longer requires variable Just to be sure can you add print of variable a in addition to time stats? |
I re-wrote your benchmark to make sure your measurements do not get affected by optimizations in a best possible way. Moving forward: My numbers might be different from yours as I have different hardware to yours so you should not judge it strictly
I made it pretty long to check all inputs from length 1 to 1024 My results(I made only extract to highlight important break points) show quite different picture:
P.S. I removed Sip hasher because no one really cares about it P.S.S. Note that SIMD instructions make difference only starting from length 240+ and in this case you should enable at least AVX2 via RUSTFLAGS as I mentioned above for optimal performance on x86 (if your CPU supports it) |
Yeah, I had added variable "a" to prevent compiler from optimizing the code away. The println! for a disappeared in this version during refactoring. Added it back and re-ran the test with and without AVX2. Also changed the output format to make it easy to read:
|
I ran another test with LTO enabled and AVX2 enabled. Previous tests only had opt-level=3. This is still on the linux machine - "x86_64 GNU/Linux"
|
Did you wrap every computation into black box as I shown previously? |
On side note while playing with your benchmark I noticed that compiler didn't inline some internal functions properly so I re-worked it a bit to improve performance quite a bit |
Hi,
I have following test([1]) to benchmark the hash function. I am comparing SipHasher, twox_hash and xxh3_64 (from this git repo). I always get sub-par performance from xxh3_64 from this git repo. [0] shows the features enabled by default in cargo and the results of this test. What am I doing wrong?
[0]
[1]
The text was updated successfully, but these errors were encountered: