You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
eliminate the dead iterate branch in _unsafe_(get)setindex!. (#52809)
It's sad that compiler can't do this automatically.
Some benchmark with `setindex!`:
```julia
julia> a = zeros(Int, 100, 100);
julia> @Btime $a[:,:] = $(1:10000);
1.340 μs (0 allocations: 0 bytes) #master: 3.350 μs (0 allocations: 0 bytes)
julia> @Btime $a[:,:] = $(view(LinearIndices(a), 1:100, 1:100));
10.000 μs (0 allocations: 0 bytes) #master: 11.000 μs (0 allocations: 0 bytes)
```
BTW optimization for `FastSubArray` introduced in #45371 still work
after this change as the parent array might have their own `copyto!`
optimization.
0 commit comments