hash-bench icon indicating copy to clipboard operation
hash-bench copied to clipboard

add benchmark cases for stream version hash

Open gzm55 opened this issue 4 years ago • 0 comments

Now we have three type of inputs: byte[], ByteBuffer and DIrectBuffer. In many real scenarios, the input will be objects to be serialized to bytes or an io stream with uncertain length. Some hash implementation provide streaming api (e.g. Guava Hasher), which are verify convenient for these cases, and should have better performance.

We can split a fixed length byte[] array into some small pieces, and feed into a streaming api hash algo. A default streaming api to wrap a hash with only at-once api just records all updated bytes into a ByteBuffer, and calculate the whole result at once in finally().

gzm55 avatar Feb 24 '20 12:02 gzm55