# Trait dispatch causing allocations

**URL:** https://discourse.julialang.org/t/trait-dispatch-causing-allocations/75742
**Category:** Performance
**Tags:** dispatch, traits, allocations
**Created:** [February 3, 2022, 5:32pm UTC](https://discourse.julialang.org/t/trait-dispatch-causing-allocations/75742 "2022-02-03T17:32:23Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)
#### Post date: [February 3, 2022, 6:37pm UTC](https://discourse.julialang.org/t/trait-dispatch-causing-allocations/75742/2 "2022-02-03T18:37:45Z")

</div>

I think you are reaching the cases where run time dispatch is kicking in. This kind of stuff is discussed in [this thread](https://discourse.julialang.org/t/union-splitting-vs-c/61772) and other ones linked there, and I don’t think there is an ideal solution.

---

_[View the full topic](https://discourse.julialang.org/t/trait-dispatch-causing-allocations/75742)._
