Comments (3)
On the speed issue, Hash-Bench tests over 100 hash implementations on the JVM and finds Zero-Allocation-Hashing's XXH64 is the fastest. Feel free to check the published results for yourself for the buffer sizes and types you wish to hash (ie direct ByteBuffer, on-heap ByteBuffer, plain byte[]) but SipHash is consistently slower. For example, a standard byte[32] with XXH64 hashes in 9 ns vs 52, 114, and 127 ns for the three Java SipHash implementations that Hash-Bench tests.
I don't see much reason to add extra hashers to Zero-Allocation-Hashing unless the algorithm has a material speed or functional advantage. To this end maybe Daniel Lemire's CLHash is worth exploration (see here which also includes a SipHash performance comparison).
from zero-allocation-hashing.
I agree that SipHash is slower than other simple hash functions. Speed is important but you need to look at other aspects. SipHash is a cryptographic hash function. It's really fast when you compare it to other cryptographic hash functions. Maybe we can gain even better performance with a new implementation.
SipHash is also immune to Hash DoS attacks, so it is used as default hash function in many languages: Perl, Python, Ruby, Haskell, Rust... etc.
In my opinion it's really nice to have a secure hash function, especially when one of the authors is DJB. I am not telling that everyone needs SipHash. But it has unique properties and is complementary to others.
from zero-allocation-hashing.
I agree XXH64 and SipHash aim at different problems. The Hash-Bench Scope section lists some other considerations too when comparing hash algos.
If SipHash is what you would like, the three implementations currently available in Java might be sufficient for you:
- https://github.com/nahi/siphash-java-inline
- http://www.forward.com.au/pfod/SipHashJavaLibrary/index.html
- https://github.com/google/guava/wiki/HashingExplained
See Hash-Bench's 32 byte SipHash Report if you'd like graphs comparing their performance (summary: siphash-java-inline is more than twice as fast as the next fastest alternative).
from zero-allocation-hashing.
Related Issues (20)
- Class loading deadlock when using LongTupleHashFunction & LongHashFunction HOT 7
- XXH3_128bits HOT 3
- migrating CI to travis-ci.com
- Release to Maven central HOT 5
- Support for JDK Jigsaw Modules HOT 3
- How to build to a jar? Can't find main class HOT 2
- Hashing a CharSequence directly HOT 6
- release failed HOT 5
- Endianness and hashLong HOT 1
- Replace Unsafe with VarHandle HOT 7
- Murmur3 is incompatible with C++ reference implementation for negative seed values HOT 2
- Github Action fails on pull request: Build and analyze HOT 2
- net.openhft.hashing.UtilTest#testStringHash fails on Zing HOT 3
- Support jakarta HOT 1
- Possible alignment issues crashing JVM on SPARC platform HOT 6
- murmur3: different output for hashChars() and hashBytes() HOT 2
- Release notes for version 0.16? HOT 1
- How to correctly calculate hash for byte[][]?
- can you implement balloon hash and argon ? HOT 1
- can you support for cityhash 1.0.3 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zero-allocation-hashing.