When using static arrays, I noticed that there is a huge efficiency loss depending on how you convert/create static matrices:
using StaticArrays code_fast()