help-octave
[Top][All Lists]
Advanced

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

Re: Plotting with 3.2.0 on Windows is SLOOOOOOWWWW


From: Olli Saarela
Subject: Re: Plotting with 3.2.0 on Windows is SLOOOOOOWWWW
Date: Tue, 4 Aug 2009 23:08:01 +0300

Hello,

>> !         if (isempty (str))
>> !           sleep(0.05);
>> !         else
>
>I have tested on computer in my home (cpu Celerron M 1.3GHz)
>Why 'else' is here?
> With this 'else' plot was failled.

When applying the patch, did you notice the removal of the "!" operator from "if (! isempty (str))"? For me the patch works, but if I remove the "else" then it fails.

The "else" is there in order to preserve the original program logic. In both the original code

         if (! isempty (str))
             str = regexp (str, "OCTAVE:.*", "match");

and in the patched code

         if (isempty (str))
            sleep(0.05);
         else
           str = regexp (str, "OCTAVE:.*", "match");

the contents of the variable str are parsed with regexp() if str is not empty.

If this doesn't solve the problem, the what is the error message you get when the plot fails?

Best regards,
  Olli


2009/8/4 Tatsuro MATSUOKA <address@hidden>
Hello

--- Olli Saarela  wrote:

> I was looking for a CPU consuming loop in the C++ code, but there might
> actually be some in the script files. Does this help?
>
> *** __gnuplot_get_var__.m~      Tue Jun  9 23:22:14 2009
> --- __gnuplot_get_var__.m       Mon Aug  3 13:52:35 2009
> ***************
> *** 125,135 ****
>         fflush (ostream);
>
>         str = {};
>         while (isempty (str))
>           str = char (fread (istream)');
> !         if (! isempty (str))
>             str = regexp (str, "OCTAVE:.*", "match");
>             str = str{end}(8:end);
>           endif
>           fclear (istream);
>         endwhile
> --- 125,137 ----
>         fflush (ostream);
>
>         str = {};
>         while (isempty (str))
>           str = char (fread (istream)');
> !         if (isempty (str))
> !           sleep(0.05);
> !         else
>             str = regexp (str, "OCTAVE:.*", "match");
>             str = str{end}(8:end);
>           endif
>           fclear (istream);
>         endwhile
>
>
> On my multicore machine the tic-toc timing is practically the same, but
> cputime() shows a significant speed-up.
>

First
> !         if (isempty (str))
> !           sleep(0.05);
> !         else

I have tested on computer in my home (cpu Celerron M 1.3GHz)
Why 'else' is here?
With this 'else' plot was failled.

I remove 'else' and tested argument of sleep from 0.05 to 1 with task manager active.
Octave consumed 99% cpu time while loop of this test.
N = 100;
n = 2;
m = 2;
tic
for i = 1:n*m
   x = rand (2,N);
   subplot (n,m,i);
   plot (x(1,:),x(2,:));
end
toc


Regards

Tatsuro

--------------------------------------
Power up the Internet with Yahoo! Toolbar.
http://pr.mail.yahoo.co.jp/toolbar/


reply via email to

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