# Why this function is type unstable

**URL:** <https://discourse.julialang.org/t/why-this-function-is-type-unstable/11212>\
**Category:** General Usage\
**Tags:** question\
**Created:** [May 29, 2018, 1:57am UTC](https://discourse.julialang.org/t/why-this-function-is-type-unstable/11212 "2018-05-29T01:57:33Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [May 30, 2018, 6:36am UTC](https://discourse.julialang.org/t/why-this-function-is-type-unstable/11212/13 "2018-05-30T06:36:59Z")

</div>

> [@Chong\_Wang](#):
>
> type instability can grow rather badly in a complex system

Using [function barriers](https://docs.julialang.org/en/latest/manual/performance-tips/#kernal-functions-1), I found that I can contain it when necessary, leaving type unstable code mostly in the high-level logic where it has no significant performance impact.

> [@Chong\_Wang](#):
>
> can you point me to the issue or pull request?

[Eg here](https://discourse.julialang.org/t/how-smart-is-the-0-7-compiler/9419/2), but the whole topic is informative.

---

_[View the full topic](https://discourse.julialang.org/t/why-this-function-is-type-unstable/11212)._
