impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jim Apple (Code Review)" <ger...@cloudera.org>
Subject [Impala-ASF-CR] IMPALA-5754: Improve randomness of rand()/random()
Date Tue, 14 Nov 2017 17:32:22 GMT
Jim Apple has posted comments on this change. ( http://gerrit.cloudera.org:8080/8355 )

Change subject: IMPALA-5754: Improve randomness of rand()/random()
......................................................................


Patch Set 8:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/8355/6/be/src/exprs/math-functions-ir.cc
File be/src/exprs/math-functions-ir.cc:

http://gerrit.cloudera.org:8080/#/c/8355/6/be/src/exprs/math-functions-ir.cc@179
PS6, Line 179:   thread_local std::uniform_real_distribution<double> distribution(min,
max);
> You're right. I think thread_local is better than static to avoid the guard
I'm not confident that works nicely with boost::thread and pthreads. I emailed dev@.

I'd suggest no storage modifier at all in this patch, getting it committed, then revisiting
if useful for once the semantics are clearer. In this case, it appears that std::uniform_real_distribution
does very little initialization code and so it has very little performance penalty to run
it in every execution.



-- 
To view, visit http://gerrit.cloudera.org:8080/8355
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Idafdd5fe7502ff242c76a91a815c565146108684
Gerrit-Change-Number: 8355
Gerrit-PatchSet: 8
Gerrit-Owner: Kim Jin Chul <jinchul@gmail.com>
Gerrit-Reviewer: Attila Jeges <attilaj@cloudera.com>
Gerrit-Reviewer: Jim Apple <jbapple-impala@apache.org>
Gerrit-Reviewer: Kim Jin Chul <jinchul@gmail.com>
Gerrit-Comment-Date: Tue, 14 Nov 2017 17:32:22 +0000
Gerrit-HasComments: Yes

Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message