Le mercredi 26 novembre 2014 à 09:26 -0800, Emerson Vitor Castelani a
écrit :
> Humm, It's useful but I guess that the problem is something in loop
> while...
If I were you I'd have a look at where time is spent are where
allocations are happening, and try to improve this by writing explicit
loops at the relevant places. See how to use the profiler and track
memory allocation here:
http://docs.julialang.org/en/latest/stdlib/profile/#stdlib-profiling


Regards


> Em quarta-feira, 26 de novembro de 2014 15h05min03s UTC-2, Stefan
> Karpinski escreveu:
>         I'm not sure if this is the problem, but changing the type of
>         a variable in a function body causes problems for type
>         inference. For that reason, the first two lines of this code
>         may cause performance issue if you call this with b and c as
>         matrices. A more Julian idiom for this is to do something like
>         this:
>         
>         
>                 function simplex(A::Matrix, b::Vector, c::Vector)
>                     (m,n) = size(A); 
>                     ...
>                 end
>                 simplex(A::Matrix, b::Matrix, c::Matrix) = simplex(A,
>                 vec(b), vec(c))
>         
>         
>         This also avoids copying the data of b and c needlessly.
>         
>         
>         On Wednesday, November 26, 2014, Emerson Vitor Castelani
>         <[email protected]> wrote:
>                 Have you considered the example scsd8.mat?
>                 
>                 Em quarta-feira, 26 de novembro de 2014 14h39min14s
>                 UTC-2, Pileas escreveu:
>                         Result with tic() toc() at the very beginning
>                         and at the very end:
>                         
>                         
>                         elapsed time: 0.025719973 seconds
>                         
>                         
>                         
>                         
>                         Τη Τετάρτη, 26 Νοεμβρίου 2014 11:06:26 π.μ.
>                         UTC-5, ο χρήστης Emerson Vitor Castelani
>                         έγραψε:
>                                 Well, I am tried to implement a simple
>                                 version of simplex in Julia and I have
>                                 had some troubles. In Julia, my
>                                 algorithm spends about 30 sec and in
>                                 matlab/octave 3 sec for the same
>                                 problem. So, I saw some tips in order
>                                 to get a better performance but the
>                                 best that I got in Julia was 17-20
>                                 sec. The codes are in attachment. I am
>                                 new in Julia and the algorithms are
>                                 little roughly implemented but they
>                                 are very similar.
>                                 
>                                 
>                                 Thanks
>                                 
>                                 
>                                 
>                                 

Reply via email to