You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reduced example in that issue might not get fixed. The extra code allows dynamic dispatch to a version of g specialized for f. The method in the example is probably not performance-critical, since all it does is call another function. This is part of the cost of faster higher-order functions.
So closing this but I don't know how to solve the problem...
A possible workaround is to force specialization like this:
function knn_kernel2!{F<:Function}(index::Int, skippoint::F)
But this is definitely a real issue, concerning the performance of dynamic dispatch and our calling convention. However fixing it is definitely a long-term project.
Just having a function as an argument in a recursive function creates an allocation at each call. This is a minimized example from one of my packages:
Is there anyway to workaround this?
The text was updated successfully, but these errors were encountered: