Optimize RandomGenerator::nextBytes

Glavo zjx001202 at gmail.com
Mon Dec 25 03:29:47 UTC 2023


I created a PR[1] to optimize the implementation of `nextBytes`  in Random
and RandomGenerator by using Unsafe and ByteArrayLittleEndian.

JMH benchmarking says it's very useful, with performance improvements of up
to 180% in some cases.

Would anyone like to take a look at it?

Glavo

[1]: https://github.com/openjdk/jdk/pull/14638
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20231225/e724ed6b/attachment.htm>


More information about the core-libs-dev mailing list