I’ve made a comparison not long ago: Performance disadvantages of structs? - #12 by Skoffer
Generally if you do everything correctly then immutable structures should work faster than mutable. If you see the opposite, usually it’s some non-idiomatic usage.
And of course, this distinction immutable/mutable only applies to small objects (like Agent
in your examples). If you have hundreds of agents, they should be contained in mutable Vector/Matrix, because that’s what Vector is for.