|
From: | Søren Hauberg |
Subject: | Re: speed of octave |
Date: | Thu, 06 Sep 2007 23:52:05 +0200 |
User-agent: | Thunderbird 1.5.0.13 (X11/20070824) |
frank wang skrev:
You are working with such a short running program that I think the factor 30 is computed very non-robust. But, yes it is true that Octave is slower than matlab when working with loops. Matlab comes with a Just-in-Time compiler which can speed up the processing of loops quite a bit. Octave does not have such a feature. The main issue is that most of the people developing Octave aren't the kind of people that enjoy writing compilers. So if you know anybody who likes doing that, feel free to persuade them to work on a Just-in-time compiler for Octave :-)while trying to find the speed of octave, scilab and matlab, I found the following test code and decided to run it on octave 2.9.13 (window) and matlab 7.1a. The result shows that octave is 30 time slower than matlab. in Matlabe: tic; z=bench1(10); toc; Elapsed time is 0.015060 seconds. in octave: tic; z=bench1(10); toc; Elapsed time is 2.704300 seconds.
Søren
function [z]=bench1(n) for i=1:n, for j=1:1000, z=log(j); z1=log(j+1); z2=log(j+2); z3=log(j+3); z4=log(j+4); z5=log(j+5); z6=log(j+6); z7=log(j+7); z8=log(j+8); z9=log(j+9); end end z = z9; Thanks Frank _______________________________________________ Help-octave mailing list address@hidden https://www.cae.wisc.edu/mailman/listinfo/help-octave
[Prev in Thread] | Current Thread | [Next in Thread] |