Need help on understanding type inference / performance

It’s presumably related to this:
https://docs.julialang.org/en/v1/manual/performance-tips/#Be-aware-of-when-Julia-avoids-specializing

I.e. Julia intentionally does not specialize instantiate_wrapper1 because the input type is not used directly in the function. However, I do agree that this behaviour is a bit of a footgun, or at least can be perplexing.

3 Likes