alphazero / Blake2b

Java implementation of the BLAKE2b cryptographic hash function
Other
79 stars 22 forks source link

VarHandles not Unsafe #6

Closed ghadishayban closed 5 years ago

ghadishayban commented 5 years ago

On Java 9+ there is a new class VarHandle that allows reading a byte[] as a long[] without resorting to Unsafe. Benchmarks appear to be nearly identical with the unsafe branch...maybe a tiny bit faster.

Just going to put this draft PR here. Not asking for anything to be merged or any action to happen.

alphazero commented 5 years ago

Thanks for the heads-up @ghadishayban, didn't know about that. I haven't been keeping up with the Java ecosystem, so the question is how prevalent is the adoption of Java 9+?

alphazero commented 5 years ago

@ghadishayban Let's do this. I'll branch off unsafe and push to varhandles, and if you don't mind you can re-issue the PR based on that branch. [edit; you have your branch]