Comments (3)
Removing the currently-present API (single method calls) and making users to emulate it would be a bad decision, because requiring people to call three methods when just one suffices 95% of the time doesn't make sense.
Augmenting the current API with support for chaining is possible.
from zero-allocation-hashing.
Agreed, removing / breaking the current API would be a mistake. Doing a bit of refactoring to enable chaining seems like a better move as you suggest.
from zero-allocation-hashing.
Streaming version api (with state) can be use to wrap a hash function as a OutputStream
. It will reduce the overall allocations when we hash an object, which is the real scene in many RPC servers.
With stateless api, hashing the object will perform many allocations on the serialization step:
ByteBuffer/byte[] ser_results = do_serialization(obj);
long h = long_function.hash64(ser_results);
Meanwhile, the streaming api will be friendly for less allocations:
HashOutputStream hash_stream = wrap_streaming_hash(long_function_streaming);
do_serialization_to_a_stream(ser_results, hash_stream);
long h=hash_stream.finalize();
from zero-allocation-hashing.
Related Issues (20)
- Release 0.12 with 128 bit hashes HOT 4
- Release latest version to Maven central HOT 8
- 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[][]?
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.