I tried this examples. It only improves if xprime is not allocated over and 
over. Instead, try fill!(xprime,1.0) for ones(...). Also, colon indexing 
xprime[:] allocates memory. Instead, you can use reinterpret/reshape. In real 
code, xprime should not be re-allocated with ones method.
You can update it with @inbounds macro in for loops. At least, updating xprime 
and not using xprime[:] solves wasted allocations issue (by doing these in my 
trials overall allocated memory was around 1/3 of the original example).

Reply via email to