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
Gray.(img) is used widely tha Array{Gray, 2}(undef, sz...) or zeros(Gray, sz) becomes very alluring. However, there's a significant performance gap here:
This is probably a JuliaImages specific confusion, because when we write Array{AbstractFloat, 2} we know it's an abstract type. But for Gray it's very likely that users don't get this.
because you've failed to specify the dimensionality. It happens for any parametric structure that you don't provide values for all fields.
But I agree that we might want to have a section somewhere early for Julia newbies. As you know, getting this wrong affects not just the initial allocation but also the subsequent usage of the object.
Gray.(img)
is used widely thaArray{Gray, 2}(undef, sz...)
orzeros(Gray, sz)
becomes very alluring. However, there's a significant performance gap here:This is probably a JuliaImages specific confusion, because when we write
Array{AbstractFloat, 2}
we know it's an abstract type. But forGray
it's very likely that users don't get this.Ref: https://docs.julialang.org/en/v1/manual/performance-tips/#man-performance-abstract-container-1
The text was updated successfully, but these errors were encountered: