# Dictionaries vs Mutable structs

**URL:** <https://discourse.julialang.org/t/dictionaries-vs-mutable-structs/19788>\
**Category:** New to Julia\
**Created:** [January 18, 2019, 3:21pm UTC](https://discourse.julialang.org/t/dictionaries-vs-mutable-structs/19788 "2019-01-18T15:21:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![curious](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/curious/32/7629_2.png) [@curious](https://discourse.julialang.org/u/curious)\
**Post date:** [January 18, 2019, 3:21pm UTC](https://discourse.julialang.org/t/dictionaries-vs-mutable-structs/19788/1 "2019-01-18T15:21:30Z")

</div>

Hello,

Are there any rules of thumb that one can use to choose between Dictionaries and Mutable structs? I am trying to understand when is it better to choose one over other, since I think both can be used in some cases.

Thank you.

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [January 18, 2019, 3:23pm UTC](https://discourse.julialang.org/t/dictionaries-vs-mutable-structs/19788/2 "2019-01-18T15:23:22Z")

</div>

Do you have a small fixed amount of data with known names and types? Then you may want a mutable struct. Do you have a large amount of data with variable names and either unknown type or all the same type? Then you may want a dictionary. Mutable structs are also much smaller and more efficient than dictionaries. There are certainly cases where you could use either one.

---

<div class="post-metadata">

**Author:** ![curious](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/curious/32/7629_2.png) [@curious](https://discourse.julialang.org/u/curious)\
**Post date:** [January 19, 2019, 12:36am UTC](https://discourse.julialang.org/t/dictionaries-vs-mutable-structs/19788/3 "2019-01-19T00:36:35Z")

</div>

Thanks very much for these pointers. That makes it easy to decide in my case.
