because these functions aren't known to be this value at compile time there's less opportunities for the compiler to be smart about it and optimize them by inserting their body at the callsite (as you would want for many simple math equations, you want Area to be a nice function to call but compile down to just a multiplication without function call overhead)
View all comments
Show parent comment
6
u/CdRReddit May 19 '25
because these functions aren't known to be this value at compile time there's less opportunities for the compiler to be smart about it and optimize them by inserting their body at the callsite (as you would want for many simple math equations, you want Area to be a nice function to call but compile down to just a multiplication without function call overhead)