On Thu, 2 Dec 2021 23:02:57 GMT, Paul Sandoz <[email protected]> wrote:
>> Vamsi Parasa has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> add seeds for the random generators to eliminate run-to-run variance
>
> test/micro/org/openjdk/bench/java/util/RandomGeneratorNext.java line 57:
>
>> 55: rngL128X128MixRandom =
>> RandomGeneratorFactory.of("L128X128MixRandom").create(42);
>> 56: rngL128X256MixRandom =
>> RandomGeneratorFactory.of("L128X256MixRandom").create(174);
>> 57: rngL128X1024MixRandom =
>> RandomGeneratorFactory.of("L128X1024MixRandom").create(308);
>
> You can declare parameters:
>
>
> @Param({"L128X128MixRandom", "L128X256MixRandom", "L128X1024MixRandom"})
> String randomGeneratorName;
>
> @Param("1024")
> int size;
>
> long[] buffer;
> RandomGenerator randomGenerator;
>
>
> @Setup
> public void setup() {
> buffer = new long[size];
> randomGenerator = RandomGeneratorFactory.of(randomGeneratorName)
> .create(randomGeneratorName.hashCode());
> }
>
>
> Then you can simplify to just two benchmark methods. Further, the benchmark
> can be used for other PRNGs.
@PaulSandoz Implemented the changes you suggested for the benchmark. Tested it
on my side and ensured that it's working as expected...
-------------
PR: https://git.openjdk.java.net/jdk/pull/6206