Update README.md and benchmarks #291
Labels
No labels
announcement
bug
build
CI
dependencies
documentation
duplicate
enhancement
experience feedback
feature request
github_actions
help wanted
install
invalid
Long-term
optimization
portability
question
target-specific
test issue
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-Cyan4973/xxHash#291
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently, the benchmarks and SMHasher scores shown in README.md and xxhash.h are out of date. They should be updated, as XXH32 fails SMHasher and they don't include the newer hashes.
@Cyan4973 Do you think you can update the tables before the next release?
Likely, yes.
But I'm not sure what's best, to update the README now, or is it better to wait for
v0.8.0.In the meantime, I've also setup https://github.com/Cyan4973/xxHash/wiki/Performance-comparison .
The main idea is that the README will only be able to present a few numbers, a sort of very summarized view, while more involved comparisons with more figures will be performed in the wiki.
I'm fine with waiting until
v0.8.0.Also, are these the latest graphs or just for
v0.7.0?Not sure if it's
v0.7.0, but it's definitely not latest version.Yep, to update too.
When testing, can you make sure to use the
-mno-avx256-split-unaligned-loadflag on GCC+AVX2? That will give a more fair benchmark to GCC.Sure !
I tried it, in
mingw64, and something very strange happened :the
seededvariant ofxxh3ended up being much faster than the non-seeded one ....gcc+ nosplit +avx2, unseeded : 34 GB/sgcc+ nosplit +avx2, seeded : 45 GB/sclang+avx2, both : 46 GB/sThat's unexpected. The
unseededvariant is supposed to be the faster one ...If anything, the
seededvariant checks if the seed is0, and in this case, defers to theunseededvariant, so it should be equivalent.However, the benchmark actually changes the seed at each iteration, so the
seededvariant cannot take advantage of this shortcut.Still, it doesn't explain why it's faster.
The
seededvariant is supposed to build a newsecretat runtime, and then pass the newly created secret as argument to the hot loop. If anything, this is more work compared to theunseededvariant, which just pass the pre-computedsecretwithout any runtime effort.I guess that GCC tried to constant fold
kSecretand it failed miserably. I'll have to check the assembly.I'm getting it slightly slower (58.9/60) but not the amount that you are experiencing. This was done on mingw64 with GCC 9.2.0.
What GCC version do you have? And can you run
gcc -S -masm=intel (flags) xxhash.c -o xxhash.sand then give me xxhash.s?I'm using the same version of gcc,
v9.2.0, onmingw64:gcc version 9.2.0 (Rev2, Built by MSYS2 project)Also note that I'm compiling with
-mno-avx256-split-unaligned-loadas you suggested. Without it, both variants are down to 30 GB/s.Note sure if that makes sense, but I found a direct link with the
XXH_align()statement in front the stack area reserved for the customsecret.In current code, this area is aligned on 8 bytes (not sure why). If it's aligned on 8 or 16 bytes, then the speed of
seededvariant gets a boost. If it's aligned on32or64bytes, then the speed goes down, to the level of the unseeded variant.This goes contrary to expectation. It's as if
avx2unaligned load is faster than aligned one.Note that
kSecretis aligned on64bytes, but even when I change that statement, performance doesn't move.I am seeing slight variation on the alignment, but not much.
Does removing the optimize pragmas and using
-O3help?https://gist.github.com/Cyan4973/6266189692549d2fa9deab7cc086ccfb
more verbose version :
https://gist.github.com/Cyan4973/bf74a910f1906e16703495cc9f064728
I'm wondering if this could be a cpu specific effect...
I'm getting the same speeds, so it might be cpu-specific.
As for the verbose version, ow my eyes 😂
Err… @Cyan4973, why 0.7.3 SSE2 executes silently on Windows 7 x64? Created #343.
Damn, this better not be another Unicode wrapper bug.......
Visual Studio implies SSE2 for x64 compiles
Well, of course it would. SSE2 is required for x86_64. That was one of the reasons we chose SSE2 (and NEON), no compat checks.
It also assumes SSE2 on x86 because Windows 7 and later require it.
For the time being, performance comparison is updated in :
https://github.com/Cyan4973/xxHash/wiki/Performance-comparison
On reaching
v0.8.0, parts of the wiki will be used to update the performance section withinREADME.md.README.mdhas been updated with recent benchmark measurements, extracted from the wiki