+3. Being stored "inline" in other data structures. e.g. a length-$N$ array `Vector{SVector{3, Float64}}`, such as `[v1, v2, v3]` from the `SVector`s in the previous example, is stored as $3N$ *consecutive* `Float64` values. This is *much* more efficient to access than a `Vector{Vector{Float64}}`, which is essentially an array of pointers to `Vector{Float64}` arrays, and is often faster and more convenient than a $3 \times N$ `Matrix{Float64}` (e.g. because the length 3 is stored in the type you get the benefits of (1) and (2) when accessing vectors in the array, and no "slicing" or "views" are needed). (There is also [HybridArrays.jl](https://github.com/JuliaArrays/HybridArrays.jl) for matrices with a static number of rows.)
0 commit comments