Re: RFR: 8275821: Optimize random number generators developed in JDK-8248862 using Math.unsignedMultiplyHigh() [v5]

2021-12-02 Thread Vamsi Parasa
On Fri, 3 Dec 2021 00:27:13 GMT, Paul Sandoz  wrote:

>> 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
>
> test/micro/org/openjdk/bench/java/util/RandomGeneratorNext.java line 47:
> 
>> 45: public class RandomGeneratorNext {
>> 46: 
>> 47: public RandomGenerator randomGenerator;
> 
> Suggestion:
> 
> RandomGenerator randomGenerator;

Incorporated your suggestion in the recent commit...

> test/micro/org/openjdk/bench/java/util/RandomGeneratorNext.java line 52:
> 
>> 50: String randomGeneratorName;
>> 51: 
>> 52: public static long[] buffer;
> 
> Suggestion:
> 
> long[] buffer;

Incorporated your suggestion in the recent commit...

> test/micro/org/openjdk/bench/java/util/RandomGeneratorNext.java line 69:
> 
>> 67: 
>> 68: @Benchmark
>> 69: @Fork(1)
> 
> Why is `@Fork` need here?

Removed the @Fork annotation...

> 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

Added the code to return buffer at the end of the loop...

-

PR: https://git.openjdk.java.net/jdk/pull/6206


Re: RFR: 8275821: Optimize random number generators developed in JDK-8248862 using Math.unsignedMultiplyHigh() [v5]

2021-12-02 Thread Paul Sandoz
On Fri, 3 Dec 2021 00:17:04 GMT, Vamsi Parasa  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


Re: RFR: 8275821: Optimize random number generators developed in JDK-8248862 using Math.unsignedMultiplyHigh() [v5]

2021-12-02 Thread Vamsi Parasa
> 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

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/6206/files
  - new: https://git.openjdk.java.net/jdk/pull/6206/files/78a45142..e9c71477

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=6206=04
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=6206=03-04

  Stats: 35 lines in 1 file changed: 1 ins; 20 del; 14 mod
  Patch: https://git.openjdk.java.net/jdk/pull/6206.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/6206/head:pull/6206

PR: https://git.openjdk.java.net/jdk/pull/6206