JuliaLang/julia
Vedi su GitHubConsider improving performance of rand! for view of BitArray
Open
#41.862 aperta il 11 ago 2021
help wantedperformance
Metriche repository
- Star
- (48.709 star)
- Metriche merge PR
- (Merge medio 20g 6h) (157 PR mergiate in 30 g)
Descrizione
Currently the fast path for rand! is used only for BitArray but not for views of BitArray:
julia> x = falses(10^8);
julia> y = @view x[:];
julia> @time rand!(x);
0.002921 seconds
julia> @time rand!(y);
0.206912 seconds (1 allocation: 48 bytes)
I propose to add support for views also (it requires careful handling of view boundaries along the fastest changing dimension, but for large vectors this should be negligible overhead).