Bug 57145

Summary: RandomController : Use ThreadLocalRandom instead of Random for better performances
Product: JMeter Reporter: Philippe Mouawad <p.mouawad>
Component: MainAssignee: JMeter issues mailing list <issues>
Severity: enhancement CC: p.mouawad
Priority: P2    
Version: 2.11   
Target Milestone: ---   
Hardware: All   
OS: All   

Description Philippe Mouawad 2014-10-26 14:01:48 UTC
As per javadoc:

"Instances of java.util.Random are threadsafe. However, the concurrent use of the same java.util.Random instance across threads may encounter contention and consequent poor performance. Consider instead using ThreadLocalRandom in multithreaded designs."

As we need to support Java6, I will be using Doug Lea class which is under Commons Creative License 1.0 and compatible with Apache license:


Can Works Placed In The Public Domain Be Included In Apache Products?

Works in the public domain (or covered by a license treated similarly) may be included within Apache products. Attribution is required (in a similar fashion to permissive licenses).

A work should be treated as being in the public domain when one of the following applies:

    the work is covered by
        the Creative Commons Public Domain Mark, or
        a suitable dedication (to the public domain) by the authors; or => WE ARE IN THIS CASE.
    clear evidence exists that US copyright for the work
        has expired, or
        cannot be claimed.
Comment 1 Philippe Mouawad 2014-11-26 21:18:12 UTC
Date: Sun Oct 26 14:26:10 2014
New Revision: 1634335

URL: http://svn.apache.org/r1634335
Bug 57145 - RandomController : Use ThreadLocalRandom instead of Random for better performances
Bugzilla Id: 57145

    jmeter/trunk/licenses/bin/ThreadLocalRandom.txt   (with props)
    jmeter/trunk/src/core/org/apache/jmeter/util/ThreadLocalRandom.java   (with props)