Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hoist boundscheck in vector setindex for arrays (#53149)
As noted by @N5N3 in #40962 (comment), the bounds-check on the elementwise `setindex!` prevents vectorization. Explicitly performing the bounds-check and marking the `setindex!` as `@inbounds` speeds up the operation. ```julia julia> A = zeros(1000); B = rand(1000); julia> @Btime $A[1:end] = @view $B[1:end]; 689.940 ns (0 allocations: 0 bytes) # master 97.629 ns (0 allocations: 0 bytes) # PR ```
- Loading branch information