It occurs to me, maybe mistakenly, that there is a tendency to believe that being precise with your type arguments in functions also gives you performant code. Performance Tips doesn’t explicitly mention something like that. I myself also cannot find reasons to agree with such a statement.
In my view having abstract arguments (or even ::Any
) will just oblige Julia to compile at run-time a more precise implementation of the function (aka method). So it doesn’t really make a difference, since even if I define a more precise method it will not be compiled until I call it (without considering precompilation tactics). And as long as the compilation is done, run-time execution will be the same for both cases. right?
So I would even dare to say that for readability reasons, it would be good to try to have as much abstract arguments as possible, as long as all the operations in the function body are being supported from all the type subset.
I hope posting a question here will yield a final answer and remove any doubts.