- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
add shuffle(::NTuple)
to Random
#56906
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
base: master
Are you sure you want to change the base?
Conversation
7c9cbf9
to
b2eb86a
Compare
Unlike EDIT: decided to just forgo |
I'm surprised to see that your implementation allocates on the master branch, but not on v1.12, do you have an idea why that is the case? Not necessariy a problem though, it seems to be roughly the same speed. |
Can't reproduce: julia> rng::Xoshiro = Xoshiro();
julia> tup::NTuple{15, Int} = ntuple(identity, 15)
(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)
julia> @btime shuffle(rng, tup)
71.280 ns (0 allocations: 0 bytes)
(13, 4, 6, 12, 2, 15, 3, 10, 1, 11, 8, 9, 5, 7, 14) Perhaps it was an issue only for some commits on the |
Co-authored-by: Rafael Fourquet <fourquet.rafael@gmail.com>
Co-authored-by: Rafael Fourquet <fourquet.rafael@gmail.com>
Co-authored-by: Rafael Fourquet <fourquet.rafael@gmail.com>
Co-authored-by: Rafael Fourquet <fourquet.rafael@gmail.com>
Fixes #56728