Julia hangs while displaying an SMatrix

StaticArrays aren’t a panacea that you should drop into every array computation to make them faster.

They are useful for tiny arrays (e.g. coordinate-vectors in 3d geometry) where the overhead of allocating arrays or even just looping is comparable to the cost of elementary array operations like vector + vector. For large arrays this overhead is relatively unimportant, especially if you do in-place operations, and the costs of StaticArrays (e.g. in compile time and instruction-cache overutilization) outweigh the benefits.

4 Likes