Question about @inline

performance
#1

Hello everyone,
I have a question regarding @inline: Does it propagate on all function calls inside the function that is being inlined? For example:

function compute_something(a::Float64)
   #= Some calculation and, perhaps,
   calls to other functions aswell =#
end

@inline function inlined_function()
   compute_something(0.5)
end

In this case, would the inlining be applied to all the function calls that happen in inlined_function (and, also, function calls that happen within function calls… etc…), resulting in a single big inlined function?
If that’s not the case, is there a way to achieve this? Perhaps with a @propagate_inline macro?

0 Likes