I'm trying to understand the performance gains from supplying type
information to functions. To this end, I've written a short piece of code
https://github.com/nilshg/LearningModels/blob/master/test_argument_passing.jl
that takes a vector x of the integers from 1:10 and multiplies it with
The reason for the slowdown of case 4 is that Julia is not good at
inferring the return types of functions passed as arguments to other
functions. This shows up in a few places, for instance the `map`
function has this problem too which I think has been partly hacked
around. This is a bit of a
Yes, this is the current situation. Don't call functions in this way in a hot
inner loop where you care about performance (yet). There are lots of things
that can be done to improve this situation, but it hasn't reached the top of
anyone's todo list yet.
The best current workaround is to use a