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
franckgaga
changed the title
Switch to AbstractVector and AbstractMatrix to support e.g. StaticArrays.jl
Switch to AbstractArray to support e.g. StaticArrays.jlFeb 21, 2025
I experimented a bit with StaticArrays.jl. Here's some findings:
Converting everything to AbstractVector and AbstractMatrix significantly complexifies the code and reduce it readability a lot. It needs to be really justified IMO.
I would need to use mutating static arrays, since all the struct in this package are non-mutating (the default behavior of struct). Many methods in the package are currently allocation-free with builtin arrays because I use mutation a lot (ex: updatestate! mutate .x0 or .x̂0 vector, setmodel! and linearize! mutates .A, .Bu, .Bd, .C and .D matrices, etc.)
I ran the micro-benchmark script on my computer (Julia 1.11):
the speedups of the mutating operations are modest. And it's micro-benchmarks: we cannot interpret these results as "the MPC controller would be 3.0x faster". These operations are generally not the bottleneck for MPC.
From these findings, I am not convinced at all this feature is worth the implementation.
No description provided.
The text was updated successfully, but these errors were encountered: