Intermittent type inference calls during method evaluation

rikh
Sat, 04 Jun 2022 17:07:52 +0000
Internals & Design

When looking through a first call for a longish method via StatProfilerHTML.jl, I see some type inference happening during the method body evaluation:

(This is in Julia 1.8-rc1.)

I think that this is caused by the method being too long which caused the compiler to give up on inferring the whole method. Is this assumption correct?

My guess is also that storing the methodinstance is aborted once inference takes too long, so to ensure that more methodinstances are stored, I just need to avoid methods where typeinference happens during evaluation of the body? This could explain why some methods don’t “take” if you try to precompile them as mentioned by @timholy in Consider `generate_precompile` prior to module close · Issue #38951 · JuliaLang/julia · GitHub

3 posts - 2 participants