You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd take me a bit of time to get my head around that code now, but wouldn't it be possible to run everything through the matrix matrix path with reshape in and out? It should be no-op for SVector -> SMatrix -> SVector, it's the same memory.
That code is generic for other static vector types where reshaping adds a wrapper. Maybe Julia could optimize it out well enough but I'm not sure. It's certainly not an obviously simpler solution than optimizing the matrix-vector code.
Activity
mateuszbaran commentedon Jun 10, 2026
Good catch. The logic here:
StaticArrays.jl/src/matrix_multiply.jl
Lines 94 to 102 in f02280c
StaticArrays.jl/src/matrix_multiply.jl
Lines 135 to 158 in f02280c
ancapdev commentedon Jun 10, 2026
I'd take me a bit of time to get my head around that code now, but wouldn't it be possible to run everything through the matrix matrix path with reshape in and out? It should be no-op for SVector -> SMatrix -> SVector, it's the same memory.
mateuszbaran commentedon Jun 10, 2026
That code is generic for other static vector types where reshaping adds a wrapper. Maybe Julia could optimize it out well enough but I'm not sure. It's certainly not an obviously simpler solution than optimizing the matrix-vector code.