Re: [julia-users] Re: Memory allocation questions

2015-03-12 Thread Phil Tomson
On Thursday, March 12, 2015 at 2:14:34 AM UTC-7, Mauro wrote: Julia is not yet very good with producing fast vectorized code which does not allocate temporaries. The temporaries is what gets you here. However, running your example, I get a slightly different a different *.mem file

Re: [julia-users] Re: Memory allocation questions

2015-03-12 Thread Phil Tomson
On Thursday, March 12, 2015 at 2:14:34 AM UTC-7, Mauro wrote: Julia is not yet very good with producing fast vectorized code which does not allocate temporaries. The temporaries is what gets you here. However, running your example, I get a slightly different a different *.mem file

Re: [julia-users] Re: Memory allocation questions

2015-03-12 Thread Tim Holy
On Thursday, March 12, 2015 10:31:21 AM Phil Tomson wrote: Will this always be the case or is this a current limitation of the Julia compiler? It seems like the more idiomatic, compact code should be handled more efficiently. Having to break this out into nested for-loops definitely hurts

Re: [julia-users] Re: Memory allocation questions

2015-03-12 Thread Mauro
you should be able to write: @inbounds for y in 1:img.height @simd for x in 1:img.wid if 1 x img.wid left = img.data[x-1,y] center = img.data[x,y] @inbounds right = img.data[x+1,y] Just curious, why did you get rid of the @inbounds on the

Re: [julia-users] Re: Memory allocation questions

2015-03-12 Thread René Donner
For inplace matrix multipliation you can also try the in-place BLAS operations: http://docs.julialang.org/en/release-0.3/stdlib/math/?highlight=at_mul_b#Base.A_mul_B! Am Donnerstag, 12. März 2015 10:14:34 UTC+1 schrieb Mauro: Julia is not yet very good with producing fast vectorized code