Read about cache here: http://julialang.org/blog/2013/09/fast-numeric and add @inbounds @simd in front of the inner loop.
--Tim On Friday, July 1, 2016 8:10:33 AM CDT baillot maxime wrote: > Thank you but don't worry in general I do it like 3 or 4 times before > looking at the time :) > > I think the problem in my main (not the useless code I did to do the > benchmark) Julia code come from the BLAS library. The library look like > much slower than the library MATLAB use to do matrix element wise > multiplication. > > On Friday, July 1, 2016 at 4:53:01 PM UTC+2, Andre Bieler wrote: > > Also remember that the first time you execute a function you should not > > @time it because > > then it also measures the compilation time. You can test this by doing > > > > @time test(m,nbp) > > @time test(m,nbp) > > @time test(m,nbp) > > > > and probably see that the 2nd and 3rd time the timing is lower > > than for the first one.
