Re: [julia-users] norm() is slow when variables are arguments

2016-09-27 Thread Yichao Yu
On Wed, Sep 28, 2016 at 12:32 AM, Zhilong Liu wrote: > Hello all, > > I tried to compare two norm() computations as shown below: > > u = 1.; v = 1.; > > # case 1: constants as arguments > @time for i = 1 : 1 > g = k * norm([1.; 1.])^3 > end > > # case 2: variables as arguments > @time for i

[julia-users] norm() is slow when variables are arguments

2016-09-27 Thread Zhilong Liu
Hello all, I tried to compare two norm() computations as shown below: u = 1.; v = 1.; # case 1: constants as arguments @time for i = 1 : 1 g = k * norm([1.; 1.])^3 end # case 2: variables as arguments @time for i = 1 : 1 g = k * norm([u; v])^3 end And the computation speed in case