Various Random things (Was: Java 8 RFC 7189139: BigInteger's staticRandom field can be a source of bottlenecks)

Joe Darcy joe.darcy at
Thu Sep 5 03:42:11 UTC 2013


I don't think the specification of the new method is acceptable in its 
current form. At a minimum, some guidance should be provided on the 
properties the supplied random number generator should have to work with 
the primality tests that are being used. (Offhand, I don't know what 
those criteria are.)


On 9/4/2013 4:26 PM, Brian Burkhalter wrote:
> On Sep 3, 2013, at 5:11 PM, Brian Burkhalter wrote:
>> On Sep 3, 2013, at 5:09 PM, Doug Lea wrote:
>>> Only adding isProbablePrime seems to be an OK conservative
>>> move: no existing usages would be affected, but users would
>>> need to somehow be told that they could improve performance
>>> by changing their code to use the new method with
>>> ThreadLocalRandom.current() as argument.
>> This is what I was thinking. Some verbiage update would be in order.
> I have updated the webrev
> to add the two-parameter version of isProbablePrime() which was discussed. Naturally a CCC request would be needed in the event this were to go forward.
> Comments welcome.
> Thanks,
> Brian

More information about the core-libs-dev mailing list