Big overhead with the new lazy reshape/reinterpret

Ah, sorry, yes, they’re the same now. You cannot go much lower than this, I guess.

julia> b=[SVector{3}(rand(3)) for i in 1:10^4];
julia> @btime $b[5][2];
  1.347 ns (0 allocations: 0 bytes)

It’s interesting that, despite the above, the @code_native of the lazy and eager cases is quite different.

1 Like