JuliaLang/julia

Consider improving performance of rand! for view of BitArray

Open

#41,862 opened on 2021年8月11日

GitHub で見る
 (1 comment) (4 reactions) (0 assignees)Julia (5,773 forks)batch import
help wantedperformance

Repository metrics

Stars
 (48,709 stars)
PR merge metrics
 (平均マージ 20d 6h) (30d で 157 merged PRs)

説明

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).

コントリビューターガイド