# What is the performance penalty for using MVector and MMatrix vs SVector and SMatrix

**URL:** <https://discourse.julialang.org/t/what-is-the-performance-penalty-for-using-mvector-and-mmatrix-vs-svector-and-smatrix/89490>\
**Category:** General Usage\
**Tags:** question\
**Created:** [October 29, 2022, 12:38pm UTC](https://discourse.julialang.org/t/what-is-the-performance-penalty-for-using-mvector-and-mmatrix-vs-svector-and-smatrix/89490 "2022-10-29T12:38:19Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [October 29, 2022, 12:48pm UTC](https://discourse.julialang.org/t/what-is-the-performance-penalty-for-using-mvector-and-mmatrix-vs-svector-and-smatrix/89490/2 "2022-10-29T12:48:16Z")

</div>

If the mutable type does not escape, it can be stack allocated. For example: [Help with allocations (variable length least squares) - #6 by lmiq](https://discourse.julialang.org/t/help-with-allocations-variable-length-least-squares/57931/6)

---

_[View the full topic](https://discourse.julialang.org/t/what-is-the-performance-penalty-for-using-mvector-and-mmatrix-vs-svector-and-smatrix/89490)._
