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

ASF GitHub Bot commented on STORM-1650:
---------------------------------------

Github user revans2 commented on a diff in the pull request:

    https://github.com/apache/storm/pull/1250#discussion_r57167003
  
    --- Diff: 
storm-core/src/jvm/org/apache/storm/grouping/LoadAwareShuffleGrouping.java ---
    @@ -36,7 +37,7 @@
     
         @Override
         public void prepare(WorkerTopologyContext context, GlobalStreamId 
stream, List<Integer> targetTasks) {
    -        random = new Random();
    +        random = new XORShiftRandom();
    --- End diff --
    
    Thread safety here is nice, but not a requirement.  If we double up on a 
few routs it is probably not that big of a deal.


> improve performance by XORShiftRandom
> -------------------------------------
>
>                 Key: STORM-1650
>                 URL: https://issues.apache.org/jira/browse/STORM-1650
>             Project: Apache Storm
>          Issue Type: Improvement
>            Reporter: John Fang
>            Assignee: John Fang
>
> '''Implement a random number generator based on the XORShift algorithm 
> discovered by George Marsaglia. This RNG is observed 4.5 times faster than 
> {@link Random} in benchmark, with the cost that abandon thread-safety. So 
> it's recommended to create a new {@link XORShiftRandom} for each thread.'''



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to