# Understanding SnoopCompile timings

**URL:** <https://discourse.julialang.org/t/understanding-snoopcompile-timings/116892>\
**Category:** Profiling\
**Tags:** compilation, snoopcompile\
**Created:** [July 11, 2024, 8:05am UTC](https://discourse.julialang.org/t/understanding-snoopcompile-timings/116892 "2024-07-11T08:05:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![theogf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/theogf/32/1987_2.png) [@theogf](https://discourse.julialang.org/u/theogf)\
**Post date:** [July 11, 2024, 8:05am UTC](https://discourse.julialang.org/t/understanding-snoopcompile-timings/116892/1 "2024-07-11T08:05:57Z")

</div>

Hi,

First of all [SnoopCompile.jl](https://github.com/timholy/SnoopCompile.jl) is such an amazing package! Thanks a lot @tim.holy .

After using it for a while there is still something I have trouble understanding:  
When running `@snoopi_deep f()`, the exclusive/inclusive time of the root is indicated to be specialized as “Uniquely, its exclusive time corresponds to the time spent not in julia’s type inference (codegen, llvm\_opt, runtime, etc).”

Is it to be understood that in this case, the inclusive time correspond to the total time spent on the execution (what `@elapsed` would return) and that the exclusive time corresponds to the time “not spent compiling” and hence `inclusive - exclusive` should correspond to the compilation time?

Thanks!

---

<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:** [July 15, 2024, 2:54pm UTC](https://discourse.julialang.org/t/understanding-snoopcompile-timings/116892/2 "2024-07-15T14:54:59Z")

</div>

The inclusive time is the compilation + run time. As compilation includes type-inference, `inclusive - exclusive` is the total type-inference time. “Compilation time” would include the codegen/LLVM time, and that’s not measured by `inclusive - exclusive`.

---

<div class="post-metadata">

**Author:** ![theogf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/theogf/32/1987_2.png) [@theogf](https://discourse.julialang.org/u/theogf)\
**Post date:** [July 20, 2024, 2:22pm UTC](https://discourse.julialang.org/t/understanding-snoopcompile-timings/116892/3 "2024-07-20T14:22:26Z")

</div>

Ah I see thanks, so that can be one of sources of discrepancy! Good to know!
