# Detecting dynamic dispatch

**URL:** <https://discourse.julialang.org/t/detecting-dynamic-dispatch/4331>\
**Category:** General Usage\
**Created:** [June 17, 2017, 8:07pm UTC](https://discourse.julialang.org/t/detecting-dynamic-dispatch/4331 "2017-06-17T20:07:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nitin\_Arora](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nitin_arora/32/1174_2.png) [@Nitin\_Arora](https://discourse.julialang.org/u/Nitin_Arora)\
**Post date:** [June 17, 2017, 8:07pm UTC](https://discourse.julialang.org/t/detecting-dynamic-dispatch/4331/1 "2017-06-17T20:07:02Z")

</div>

Is there a way in Julia to detect if dynamic dispatch is happening or not for a given function call? Especially when the function doesnt allocate memory?

Thanks.

---

<div class="post-metadata">

**Author:** ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)\
**Post date:** [June 17, 2017, 9:32pm UTC](https://discourse.julialang.org/t/detecting-dynamic-dispatch/4331/2 "2017-06-17T21:32:16Z")

</div>

You should be able to use the `@code_warntype` to look for type-instabilities (which will cause dynamic dispatch). If all of the types in your function are concretely inferred, then there shouldn’t be any dynamic dispatch.

[https://docs.julialang.org/en/stable/manual/performance-tips/#code-warntype](https://docs.julialang.org/en/stable/manual/performance-tips/#code-warntype)

---

<div class="post-metadata">

**Author:** ![Nitin\_Arora](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nitin_arora/32/1174_2.png) [@Nitin\_Arora](https://discourse.julialang.org/u/Nitin_Arora)\
**Post date:** [June 19, 2017, 8:13pm UTC](https://discourse.julialang.org/t/detecting-dynamic-dispatch/4331/3 "2017-06-19T20:13:38Z")

</div>

Thanks. I knew about this macro but wasn’t aware that you can also use it for detecting dynamic dispatch
