How does Julia decide whether to inline a function across module boundaries?
Updated May 16, 2026
Short answer
Inlining across modules depends on visibility, function size, type stability, and compiler heuristics.
Deep explanation
Julia's inliner evaluates whether the benefit of removing call overhead outweighs code bloat. Across module boundaries, additional constraints apply because the function may not be fully visible at compile time. If a function is small and type-stable, it is more likely to be inlined even across modules after inference.
Unlock with a Pro subscription to view this section.
View pricingReal-world example
No real-world example available yet.
Unlock with a Pro subscription to view this section.
Upgrade to ProCommon mistakes
No common mistakes listed yet.
Unlock with a Pro subscription to view this section.
Upgrade to ProFollow-up questions
No follow-up questions available yet.
Unlock with a Pro subscription to view this section.
Upgrade to Pro