[ 
https://issues.apache.org/jira/browse/RNG-104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16856971#comment-16856971
 ] 

Alex D Herbert commented on RNG-104:
------------------------------------

Results posted in RNG-75 show the quality of the SeedFactory output using 
Dieharder and BigCrush. I have rerun the results mixing the long period 
Well44497b generator with the System identity hash code or the output from 
ThreadLocalRandom:
{noformat}
RNG                                 Dieharder   TestU01 (BigCrush)
WELL_44497_B                        0,0,0,0,0   2,3,2,2,2
WELL_44497_B ^ hash code            0,0,0,0,0   2,2,2,4,2
WELL_44497_B ^ ThreadLocalRandom    0,0,0,0,0   0,0,0,1,0
{noformat}
I reran the hash code mixer as previously the mix was done after the endian 
correction for the output. This meant the most significant bit from the hash 
code (31st bit), which is always zero, ended up as the 7th bit on a little 
endian platform. Given that the test was failing on the test of the all the 
bits and the 3 least significant bits this did not make a difference. The 
generator is still no better than the default output of Well44497b. It still 
systematically fails tests 80 and 81:
{noformat}
80  LinearComp, r = 0
81  LinearComp, r = 29
{noformat}
The mix with ThreadLocalRandom is better. The only fail is a spurious fail on:
{noformat}
69  MatrixRank, L=1000, r=26
{noformat}
This suggests a mix with ThreadLocalRandom would improve the quality of the 
SeedFactory output and should improve speed. This is not possible until the 
code is updated to Java 1.7 (it is currently at 1.6). Note there is no 
outstanding Jira ticket that requires an upgrade so this change should be 
considered only when functionality in the library requires newer Java features.

> SeedFactory seed creation performance analysis
> ----------------------------------------------
>
>                 Key: RNG-104
>                 URL: https://issues.apache.org/jira/browse/RNG-104
>             Project: Commons RNG
>          Issue Type: Task
>          Components: simple
>    Affects Versions: 1.3
>            Reporter: Alex D Herbert
>            Assignee: Alex D Herbert
>            Priority: Minor
>
> The SeedFactory is used to create seeds for the random generators. To ensure 
> thread safety this uses synchronized blocks around a single generator. The 
> current method only generates a single int or long per synchronisation. 
> Analyze the performance of this approach. The analysis will investigate 
> generating multiple values inside each synchronisation around the generator.
> This analysis will also investigate methods to supplement the SeedFactory 
> with fast methods to create seeds. This will use a fast seeding method to 
> generate a single long value. This can be a seed for a SplitMix generator 
> used to create a seed of any length.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to