# Performance disadvantages of structs?

**URL:** <https://discourse.julialang.org/t/performance-disadvantages-of-structs/57397>\
**Category:** New to Julia\
**Created:** [March 17, 2021, 5:13pm UTC](https://discourse.julialang.org/t/performance-disadvantages-of-structs/57397 "2021-03-17T17:13:06Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Skoffer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/skoffer/32/378_2.png) [@Skoffer](https://discourse.julialang.org/u/Skoffer)\
**Post date:** [March 17, 2021, 7:47pm UTC](https://discourse.julialang.org/t/performance-disadvantages-of-structs/57397/7 "2021-03-17T19:47:31Z")

</div>

Well, usually you do not need mutable structures. Arrays are mutable on their own, so usually you do not need to keep them in mutable structure. You can find multiple ways to work with immutable fields in [Mutable scalar in immutable object: the best alternative?](https://discourse.julialang.org/t/mutable-scalar-in-immutable-object-the-best-alternative/57401) and references therein, for example wrap them in `Ref`. And there is always Setfield.jl, which has its problems, but still can be used to solve many tasks.

As a reward, you’ll be able to change flexibly these data containers and use as many of them as necessary.

---

_[View the full topic](https://discourse.julialang.org/t/performance-disadvantages-of-structs/57397)._
