Performance optimization on lots of small linear algebra operations

So, my full version is a little bit more complicated:

Version with Array: Minc2.jl/resample.jl at main · vfonov/Minc2.jl · GitHub
Version with StaticArrays: Minc2.jl/resample.jl at StaticArrays · vfonov/Minc2.jl · GitHub

It has lots of other dependecies, so I tried to show only the parts, that are important (I think)