What is the fastest, vector or array?

Hi there, I would like to know what do you think about the performance of different types: vector and array. Whic one is the fastest?

Vector is a special cased Array.

6 Likes

You can also check that they’re exactly the same like this:

julia> Vector{Int} === Array{Int, 1}
true

julia> Matrix{Int} === Array{Int, 2}
true

using === which checks that the two argument are exactly identical according to Julia.

6 Likes

For small arrays (rule of thumb: less that 100 elements) https://github.com/JuliaArrays/StaticArrays.jl can give a large performance benefit…

Only if the array sizes are fixed (ideally, known statically). You wouldn’t use StaticArrays for a variable-sized container.

1 Like