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

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_r57166843
  
    --- Diff: storm-core/src/clj/org/apache/storm/daemon/executor.clj ---
    @@ -698,7 +699,7 @@
             executor-stats (:stats executor-data)
             {:keys [storm-conf component-id worker-context transfer-fn 
report-error sampler
                     open-or-prepare-was-called?]} executor-data
    -        rand (Random. (Utils/secureRandomLong))
    +        rand (XORShiftRandom. (Utils/secureRandomLong))
    --- End diff --
    
    Same reason as with the spout, but differently.  There is a much higher 
likelihood that this will be used in a non-thread safe way.  But it is less 
likely that it will result in a tuple being counted improperly, unless multiple 
threads are emitting tuples for the same tuple tree.  It is unlikely, but still 
not necessarily safe.


> 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