Re: [julia-users] Odd performance when summing/scaling more than 3 complex numbers

2014-04-29 Thread Ivar Nesje
Another point about coding style. You use the `@inbounds` macro without explicitly checking bounds first. That might be acceptable for benchmarking and testing, but when you share your code online I think it is important to be aware of the dangers if this kind of pattern is used in production co

Re: [julia-users] Odd performance when summing/scaling more than 3 complex numbers

2014-04-28 Thread Kevin Squire
Ok, gotcha. On Monday, April 28, 2014, John Travers wrote: > No, I edited the output for clarity. The slow down is consistent > regardless of order and amount of warmup. Ivar's fix of grouping into > threes using parenthesis eliminates the problem. > > On Monday, April 28, 2014 3:51:00 PM UTC+2,

Re: [julia-users] Odd performance when summing/scaling more than 3 complex numbers

2014-04-28 Thread John Travers
No, I edited the output for clarity. The slow down is consistent regardless of order and amount of warmup. Ivar's fix of grouping into threes using parenthesis eliminates the problem. On Monday, April 28, 2014 3:51:00 PM UTC+2, Kevin Squire wrote: > > Please correct me if I'm wrong, but it looks

Re: [julia-users] Odd performance when summing/scaling more than 3 complex numbers

2014-04-28 Thread Kevin Squire
Please correct me if I'm wrong, but it looks like your first set of timings include compilation time, since the amount of memory allocated is so high and you run right after using the file. Perhaps you can run it again with warmup? Kevin On Monday, April 28, 2014, John Travers wrote: > You just

[julia-users] Odd performance when summing/scaling more than 3 complex numbers

2014-04-28 Thread John Travers
Hi all, I have found some odd performance scaling when summing and scaling more than three complex numbers, see the difference between sum5 and sum5b in this gist: https://gist.github.com/jtravs/11368929 Compare: julia> using testsums julia> dosums(Complex{Float64}) elapsed time: 0.022001424