# Rules of thumb for choosing between storing information as struct field or static parameters

**URL:** https://discourse.julialang.org/t/rules-of-thumb-for-choosing-between-storing-information-as-struct-field-or-static-parameters/10202
**Category:** Performance
**Created:** [April 6, 2018, 4:40pm UTC](https://discourse.julialang.org/t/rules-of-thumb-for-choosing-between-storing-information-as-struct-field-or-static-parameters/10202 "2018-04-06T16:40:56Z")
**Posts on this page:** 1
**Showing post:** 9

<div class="post-metadata">

### Author: ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)
#### Post date: [April 6, 2018, 7:04pm UTC](https://discourse.julialang.org/t/rules-of-thumb-for-choosing-between-storing-information-as-struct-field-or-static-parameters/10202/9 "2018-04-06T19:04:57Z")

</div>

See also

> [@Overhead of dynamic dispatch?](https://discourse.julialang.org/t/overhead-of-dynamic-dispatch/7089/5):
>
> There are a number of downsides to encoding a property of your thing in the type system: There will be more time spent in compilation — every time a different type hits a different function, Julia will compile a new specialized version just for that type. If this property is typically determined by a run-time value, then many functions working with your things will be type-unstable. Type-unstable variables can stymie optimizations, cause allocations and hit dynamic dispatch. Collections of ma…

---

_[View the full topic](https://discourse.julialang.org/t/rules-of-thumb-for-choosing-between-storing-information-as-struct-field-or-static-parameters/10202)._
