# A way for identifying the code portion being re-compiled?

**URL:** <https://discourse.julialang.org/t/a-way-for-identifying-the-code-portion-being-re-compiled/99077>\
**Category:** Performance\
**Tags:** precompilation\
**Created:** [May 18, 2023, 5:49pm UTC](https://discourse.julialang.org/t/a-way-for-identifying-the-code-portion-being-re-compiled/99077 "2023-05-18T17:49:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Atiyah](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/atiyah/32/46462_2.png) [@Atiyah](https://discourse.julialang.org/u/Atiyah)\
**Post date:** [May 18, 2023, 5:49pm UTC](https://discourse.julialang.org/t/a-way-for-identifying-the-code-portion-being-re-compiled/99077/1 "2023-05-18T17:49:11Z")

</div>

**Motivation:** I done some re-structuring to my code. Afterwords, re-executing with the @time macro within REPL indicates that part of the code is getting re-compiled, e.g.

`.... seconds (... , 50.63% compilation time: 100% of which was recompilation)`

This was not the case before code re-structuring.

**Question:** Is there a quick way to find out which portion of the code is getting re-compiled?  
I am using Julia V1.9.0

---

<div class="post-metadata">

**Author:** ![mkitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkitti/32/12459_2.png) [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Post date:** [May 18, 2023, 8:29pm UTC](https://discourse.julialang.org/t/a-way-for-identifying-the-code-portion-being-re-compiled/99077/2 "2023-05-18T20:29:57Z")

</div>

The way to figure which code got recompiled can be done via SnoopCompile.jl: [Snooping on and fixing invalidations: @snoopr · SnoopCompile](https://timholy.github.io/SnoopCompile.jl/stable/snoopr/)

The code that needs to get recompiled is first “invalidated”. Followi the instructions at the link above, and it will show you how to use the `@snoopr` macro to find the invalidations.
