# Advice on using @code\_warntype

**URL:** https://discourse.julialang.org/t/advice-on-using-code-warntype/98899
**Category:** New to Julia
**Created:** [May 15, 2023, 9:26pm UTC](https://discourse.julialang.org/t/advice-on-using-code-warntype/98899 "2023-05-15T21:26:09Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![frylock](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/frylock/32/50213_2.png) [@frylock](https://discourse.julialang.org/u/frylock)
#### Post date: [May 15, 2023, 9:26pm UTC](https://discourse.julialang.org/t/advice-on-using-code-warntype/98899/1 "2023-05-15T21:26:10Z")

</div>

I get the general idea behind `@code_warntype` but LLVM is new to me. Right now, I might try `@code_warntype` on a one-liner, but with larger functions … I get lost. I use the Julia REPL, and I figure that I just look for things that are colored yellow or red to warn me of bad program design?

Is it just the sort of thing that I will pick up after a while, or should I try to learn some LLVM IR?

---

<div class="post-metadata">

### Author: ![Sukera](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Sukera](https://discourse.julialang.org/u/Sukera)
#### Post date: [May 15, 2023, 9:30pm UTC](https://discourse.julialang.org/t/advice-on-using-code-warntype/98899/2 "2023-05-15T21:30:36Z")

</div>

It depends on what level of the compilation process you’re interested in. `@code_warntype` is really good for type level help, but almost nothing of that is still visible once you hit LLVM. Conversely, the kinds of vectorization details you may be able to see in LLVM IR, are often not visible on the type level directly.

For getting a feel about type stable design, I think there isn’t a good substitute for practice, as well as checking with JET.jl and/or Cthulhu.jl.

---

<div class="post-metadata">

### Author: ![frylock](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/frylock/32/50213_2.png) [@frylock](https://discourse.julialang.org/u/frylock)
#### Post date: [May 15, 2023, 9:35pm UTC](https://discourse.julialang.org/t/advice-on-using-code-warntype/98899/3 "2023-05-15T21:35:18Z")

</div>

Thanks again!

---

<div class="post-metadata">

### Author: ![Benny](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Benny](https://discourse.julialang.org/u/Benny)
#### Post date: [May 15, 2023, 9:42pm UTC](https://discourse.julialang.org/t/advice-on-using-code-warntype/98899/4 "2023-05-15T21:42:00Z")

</div>

Also bear in mind that `@code_` assumes all arguments are specialized on, which is not always true ([issue #32834](https://github.com/JuliaLang/julia/issues/32834)). It is mentioned in the Performance Tips but it is easy to miss for a long time.

---

<div class="post-metadata">

### Author: ![tim.holy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tim.holy/32/52_2.png) [@tim.holy](https://discourse.julialang.org/u/tim.holy)
#### Post date: [May 16, 2023, 7:43am UTC](https://discourse.julialang.org/t/advice-on-using-code-warntype/98899/5 "2023-05-16T07:43:14Z")

</div>

You may find Cthulhu much easier to interpret than `@code_warntype`.

---

<div class="post-metadata">

### Author: ![frylock](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/frylock/32/50213_2.png) [@frylock](https://discourse.julialang.org/u/frylock)
#### Post date: [May 16, 2023, 11:49am UTC](https://discourse.julialang.org/t/advice-on-using-code-warntype/98899/6 "2023-05-16T11:49:28Z")

</div>

Great package name, Cthulu, the slow descent into madness! 😁
