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

Use rand(...) instead of rand(..., 1)[1] #104

Merged
merged 2 commits into from Dec 24, 2020
Merged

Use rand(...) instead of rand(..., 1)[1] #104

merged 2 commits into from Dec 24, 2020

Conversation

rikhuijzer
Copy link
Contributor

@rikhuijzer rikhuijzer commented Dec 24, 2020

Hi! I noticed that some nested loops calculate rand(d, 1)[1] a lot. This can be sped up by using rand().

julia> using Random

julia> Random.seed!(1234); rand(1)[1]
0.5908446386657102

julia> Random.seed!(1234); rand()
0.5908446386657102

@rikhuijzer
Copy link
Contributor Author

I've spotted a few more occurrences and added them in 65c16ac.

@goedman goedman merged commit 4397a64 into StatisticalRethinkingJulia:master Dec 24, 2020
@goedman
Copy link
Member

goedman commented Dec 24, 2020

Thanks a lot Rik!

@goedman
Copy link
Member

goedman commented Dec 24, 2020

StatisticalRethinking.jl v3 definitely needs quite a bit of attention. As soon as this disaster migration from Travis to GitHub actions is done it will go back on my priority list.

@rikhuijzer
Copy link
Contributor Author

StatisticalRethinking.jl v3 definitely needs quite a bit of attention. As soon as this disaster migration from Travis to GitHub actions is done it will go back on my priority list.

No worries! 😄 Rome wasn't built in a day either

@rikhuijzer
Copy link
Contributor Author

StatisticalRethinking.jl v3 definitely needs quite a bit of attention. As soon as this disaster migration from Travis to GitHub actions is done it will go back on my priority list.

By the way, feel free to notify me if CI is a problem at a later point. 😄 I like CI and have set up many things with it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants