# Performance problems when dealing with deliberately type-unstable code. How to use type knowledge better?

**URL:** <https://discourse.julialang.org/t/performance-problems-when-dealing-with-deliberately-type-unstable-code-how-to-use-type-knowledge-better/52535>\
**Category:** Performance\
**Created:** [December 28, 2020, 8:40pm UTC](https://discourse.julialang.org/t/performance-problems-when-dealing-with-deliberately-type-unstable-code-how-to-use-type-knowledge-better/52535 "2020-12-28T20:40:37Z")\
**Posts on this page:** 1\
**Showing post:** 8

<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:** [December 28, 2020, 9:49pm UTC](https://discourse.julialang.org/t/performance-problems-when-dealing-with-deliberately-type-unstable-code-how-to-use-type-knowledge-better/52535/8 "2020-12-28T21:49:42Z")

</div>

Just for reference, if you can subtype all your structs from a single abstract type, then you can use [Macro to write function with many conditionals - #8 by Skoffer](https://discourse.julialang.org/t/macro-to-write-function-with-many-conditionals/51616/8) to make union splitting irrelevant of the number of types you define.

---

_[View the full topic](https://discourse.julialang.org/t/performance-problems-when-dealing-with-deliberately-type-unstable-code-how-to-use-type-knowledge-better/52535)._
