# Type annotation make JIT compile faster?

**URL:** <https://discourse.julialang.org/t/type-annotation-make-jit-compile-faster/31906>\
**Category:** Performance\
**Tags:** compilation\
**Created:** [December 5, 2019, 2:00pm UTC](https://discourse.julialang.org/t/type-annotation-make-jit-compile-faster/31906 "2019-12-05T14:00:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AtsushiSakai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/atsushisakai/32/6559_2.png) [@AtsushiSakai](https://discourse.julialang.org/u/AtsushiSakai)\
**Post date:** [December 5, 2019, 2:00pm UTC](https://discourse.julialang.org/t/type-annotation-make-jit-compile-faster/31906/1 "2019-12-05T14:00:18Z")

</div>

I have a very simple question about Julia itself.  
Does type annotation for function make JIT compile faster?

In other words, Should I add type annotations as much as possible for good JIT compile performance?

Best

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [December 5, 2019, 2:06pm UTC](https://discourse.julialang.org/t/type-annotation-make-jit-compile-faster/31906/2 "2019-12-05T14:06:10Z")

</div>

No. You do not generally need type annotations on function arguments (except to control behavior via dispatch), nor do you need type annotations in local scope. The place that type annotations are essential for performance is on locations: the fields of structs and the element types of arrays and other data structures.

---

<div class="post-metadata">

**Author:** ![AtsushiSakai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/atsushisakai/32/6559_2.png) [@AtsushiSakai](https://discourse.julialang.org/u/AtsushiSakai)\
**Post date:** [December 5, 2019, 2:11pm UTC](https://discourse.julialang.org/t/type-annotation-make-jit-compile-faster/31906/3 "2019-12-05T14:11:11Z")

</div>

Oh, Thanks!!
