-
released this
2020-06-25 01:32:16 -05:00 | 1128 commits to dev since this releasexxHash
v0.7.4is the last evolution ofxxh3andxxh128, primarily designed to finalize the algorithm.
It is considered release candidate forv0.8.0, which means that if all goes right, this version will rebrandedv0.8.0, almost "as is", within the next few weeks, after receiving sufficient feedback.
v0.8.0is the official version after whichXXH3andXXH128are considered "stabilized", meaning that return values will never change given the sameinputandseed, making the hash suitable for long-term storage and transmission.Beyond these "final touches", the new version also brings a few notable improvements.
Automatic vector detection
x86/x64systems can enjoy a new unit,xxh_x86dispatch, which can detect at runtime the best vector instruction set present on host system (none,sse2,avx2oravx512), thanks to a cpu feature detector designed by @easyaspi314. It then automatically runs the appropriate vector code.
This makes it safer to deploy a single binary with advanced vector instruction sets, such asAVX2, since there is no hard requirement for all target systems to actually support it : the binary can automatically switch toSSE2instead.
As a proof of concept, the windows builds provided alongside this release are compiled with this new capability.AVX512supportA new vector instruction set is supported, thanks to @gzm55 :
AVX512. It can be applied onXXH3andXXH128, using some of the most recent Intel cpus, such as IceLake on laptop. It typically offers +50% more performance compared toAVX2.Secret Generator
Advanced users can be interested in the highly customizable variant
_withSecret(), which makes it possible to runXXH3andXXH128algorithms using one's ownsecret.
However, the quality of the hash depends on the high entropy (randomness) of thesecret. And sometimes, it can be difficult to ensure that the candidatesecretis "random enough".
In order to produce asecretof high quality, a new functionXXH3_generateSecret()is proposed in the advanced API section. It will convert any blob of bytes, namedcustomSeed, into a high qualitysecretwhich respects all conditions expected byXXH3andXXH128. This is true even ifcustomSeeditself is of poor quality, such as a bunch of\0bytes or some short or repeated common sequence.No API modification
The existing API present in 0.7.3 has remained unchanged in 0.7.4. Any programs linking with 0.7.3 should continue to work as-is.
Note however thatxxh3/xxh128return values are not comparable across these versions.
0.7.x are labelled development versions, and should only be used for ephemeral data (hash produced and consume in the same local session).
(note : this limitation does not extend toXXH32andXXH64, which are considered fully stable and specified).Changelist
There are multiple smaller bug fixes and minor improvements that have been brought to this repository by great contributors. Here is a summarized list:
- perf: automatic vector detection and selection at runtime (
xxh_x86dispatch.h), initiated by @easyaspi314 - perf: added
AVX512support, by @gzm55 - api : new: secret generator
XXH_generateSecret(), suggested by @koraa - api : fix:
XXH3_state_tis movable, identified by @koraa - api : fix: state is correctly aligned in AVX mode (unlike
malloc()), by @easyaspi314 - api : fix: streaming generated wrong values in some combination of random ingestion lengths, reported by @WayneD
- cli : fix unicode print on Windows, by @easyaspi314
- cli : can
-ccheck file generated bysfv - build:
make DISPATCH=1generatesxxhsumandlibxxhashwith runtime vector detection (x86/x64 only) - install: cygwin installation support
- doc : Cryptol specification of
XXH32andXXH64, by @weaversa
Downloads
-
Source code (ZIP)
0 downloads
-
Source code (TAR.GZ)
0 downloads
- perf: automatic vector detection and selection at runtime (