octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Octave vs Scilab


From: Dmitri A. Sergatskov
Subject: Re: Octave vs Scilab
Date: Wed, 6 Oct 2010 16:52:50 -0500

On Wed, Oct 6, 2010 at 4:40 PM, John W. Eaton <address@hidden> wrote:
> On  6-Oct-2010, Fotios Kasolis wrote:
>
> | So I did not manage to reproduce the example which was like 3 times faster
> | but here is another example (not that bad)
> |
> | Windows 7 with binaries Octave 3.2.4 and Scilab 5.2.2 on intel i7 720
> |
> | octave.exe:1> xmpl
> | 32.430
> |
> | ->exec('C:\Users\fotios\Desktop\xmpl.sce', -1)
> | 22.411
> |
> | where xmpl contains the very intelligent code shown below
> | N = 2000
> | A = zeros(N,N);
> | tic();
> | for i = 1:N
> |   for j = 1:N
> |     A(i,j) = i^2 + j^2;
> |   end
> | end
> | time = toc();
> | disp(time)
>
> On my system with the most recent Octave snapshot (3.3.52) I see
> 31.422 seconds for Octave and 32.9 seconds for Scilab.  And for the
> more intelligent
>
>  tic ();
>  N = 2000;
>  tmp = (1:N).^2;
>  A = repmat (tmp, N, 1) + repmat (tmp', 1, N);
>  toc ();
>
> I get about .2 seconds for Octave and and error about repmat being
> undefined in Scilab.  Using kron instead:
>
>  tic ();
>  N = 2000;
>  t1 = (1:N).^2;
>  t2 = ones (N, 1);
>  A = kron (t1, t2) + repmat (t1'; t2');
>  toc ();
>
> I get approximately the same results from Octave and
>
>                                                            !--error 17
> : stack size exceeded (Use stacksize function to increase it).
>
> from Scilab the first time I tried it, then it crashed with a segfault
> on the second attempt (not that I thought the stack size problem would
> go away, I just wanted to see what would happen).
>
> jwe
>

This test on my  5130  @ 2.00GHz Xeon takes about:

Octave: 0.08 sec
Scilab : 0.187 sec

(I got about 5% variation from repeated tests).

Dmitri.
--



reply via email to

[Prev in Thread] Current Thread [Next in Thread]