If you do not change length of xprime or use it later for another purposes then 
just update existing array instead of re-allocating each time. Also, using 
global variables in the innermost loop is very inefficient in Julia. 
It would be good to revise the code in the light of this tips from docs 
http://docs.julialang.org/en/release-0.4/manual/performance-tips/

Reply via email to