[
https://issues.apache.org/jira/browse/RNG-104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16857619#comment-16857619
]
Alex D Herbert commented on RNG-104:
------------------------------------
On the subject of using a long period generator there are two points to raise:
*Seeding the long period generator*
The generator is seeded using a SplitMix which is seeded using only 8 bytes
from SecureRandom. So there are only 2^64 possible seeds for the generator. The
number of seeds should be increased by using more values from the SecureRandom.
*How long a period is required?*
For example use a XOR_SHIFT_1024_S_PHI. The period is 2^1024. If sampled 2^30
times per second (>10 billion/sec), given 31449600 secs/year or approx 2^25, it
will take 2^969 years to repeat the period.
Basically it would be impossible to exhaust the period.
This has the following advantages:
* It is faster than Well44497b
* It produces long natively which is advantageous
* It already passes BigCrush so would not have to be mixed with another random
source to improve quality. It could still be mixed to make it unpredictable but
cryptographic security is not a requirement.
* The smaller seed would reduce initialisation cost if entirely seeded from
SecureRandom verses Well44497b
> 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)