Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge the two versions of randmtzig_{randn,exprnd} #8875

Merged
merged 1 commit into from
Nov 6, 2014
Merged

Conversation

rfourquet
Copy link
Member

Those functions are now written without @eval: I guess this was used to work around a missing rand(::MersenneTwister) method, but I may have missed something (it seems to have been written in 1cbb6d0, by @andreasnoack: can you confirm this change is OK?).

My understanding is that the speed improvements come from that the global RNG is accessed only once (as an argument of the function), instead of few times in randmtzig_randn (via rand()).

It seems to improve slightly (by about 5%) randn() methods working with the
global RNG, which now match the speed of those working with a (non-global)
MersenneTwister instance.
@andreasnoack
Copy link
Member

I think this is right, but could try to benchmark them against the old versions just to make sure that they are not slower?

@rfourquet
Copy link
Member Author

I only tested randmtzig_randn which doesn't seam to be slower (sligthly faster for the global version).

@ViralBShah
Copy link
Member

I benchmarked both, and they are faster than before.

@andreasnoack
Copy link
Member

Great. Then there shouldn't be a problem with merging this.

@ViralBShah ViralBShah merged commit 49434f8 into master Nov 6, 2014
jakebolewski added a commit that referenced this pull request Nov 7, 2014
@rfourquet rfourquet deleted the rf/randn branch November 8, 2014 13:06
@ViralBShah ViralBShah added the randomness Random number generation and the Random stdlib label Nov 22, 2014
waTeim pushed a commit to waTeim/julia that referenced this pull request Nov 23, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
randomness Random number generation and the Random stdlib
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants