On Fri, 3 Dec 2021 00:17:04 GMT, Vamsi Parasa <[email protected]> wrote:
>> This change optimizes random number generators using
>> Math.unsignedMultiplyHigh()
>
> Vamsi Parasa has updated the pull request incrementally with one additional
> commit since the last revision:
>
> Update the JMH micro to take RNG parameters for elegant implementation
Very nice, much neater, just a few more minor comments.
test/micro/org/openjdk/bench/java/util/RandomGeneratorNext.java line 47:
> 45: public class RandomGeneratorNext {
> 46:
> 47: public RandomGenerator randomGenerator;
Suggestion:
RandomGenerator randomGenerator;
test/micro/org/openjdk/bench/java/util/RandomGeneratorNext.java line 52:
> 50: String randomGeneratorName;
> 51:
> 52: public static long[] buffer;
Suggestion:
long[] buffer;
test/micro/org/openjdk/bench/java/util/RandomGeneratorNext.java line 69:
> 67:
> 68: @Benchmark
> 69: @Fork(1)
Why is `@Fork` need here?
test/micro/org/openjdk/bench/java/util/RandomGeneratorNext.java line 70:
> 68: @Benchmark
> 69: @Fork(1)
> 70: public void testFillBufferWithNextLong() {
Return `buffer` after the loop completes, just in case the JIT decides it is
otherwise dead code
-------------
PR: https://git.openjdk.java.net/jdk/pull/6206