Octave 3.0.1 plotting is very slow

Jerry lanceboyle at qwest.net
Tue Jun 3 00:30:23 PDT 2008


On May 31, 2008, at 6:55 AM, Alakazam wrote:

> Hi !
>
> On 30 mai 08, at 06:41, Jerry wrote:
>
>> I noticed that plotting with the new Octave version 3.0.1 on Macports
>> is very slow compared to older versions of Octave, e.g. 2.1.71. In
>> the old Octave, small plots appear instantaneously, probably before
>> the Return key hits its stop. In Octave 3.0.1, there is a lag of
>> about a second--enough to be slightly annoying. On larger plots, the
>> problem gets much worse. Plotting a 100,000 point vector on old
>> Octave takes 3 seconds but on Octave 3.0.1 it takes 21 seconds.
>>
>> I suppose this is something that I should take up with the Octave
>> people but I thought I'd tweak this list and the maintainer just in
>> case it is something obviously wrong with this particular version.
>
> Let me start with my (quick) tests :
>
>> octave:1> t = time(); x = [1:100000]; y = cos(x); plot(x, y); time()
>> - t
>> ans =  0.29453
>
> But as you have noted, the graphic only appears after several seconds
> (~10s on my Nov '07 Mac Book).
>
> So octave still manages the points very fast, but the graphics backend
> (X11 GnuPlot) seems to lag a bit.
>
> If my example is not valid, and doesn't illustrate your problem
> correctly, could you give some reduction cases please ?
>
> I also have a couple of questions which might help understand the
> cause of the problem.
>
>    - What machine are you running octave on ?
PPC Powerbook 1.5 GHz 2 GB
>    - What version of Mac OS X are you running ?
10.5.11
>    - How did you compile octave 2.1 ?
I downloaded it from http://hpc.sourceforge.net/ which is linked from  
http://www.gnu.org/software/octave/download.html as one of three  
binary download sites. (The others are Macports and Fink.)

>    - What graphics backend does octave 2.1 use for plotting ?

It uses gnuplot working with Aquaterm--versions of which are  
installed separately from the Macports versions.

Here are some more test results from running this program:
The setup is this, run only once per session:
   x = [1:100000];
   y = cos(x);

The timed part is this:
   t = time(); plot(x, y); time() - t

which reports an answer (call it t1) some time before the plot  
appears (and at which time the prompt returns)--the latter time I  
time on my watch call t2. In all cases the plot was run at least once  
before timing it.

Here are some results for t1 and t2 for various versions which are:
2.1.71 downloaded last year from http://hpc.sourceforge.net
3.0.1  downloaded today from http://hpc.sourceforge.net
3.0.1  installed by Macports a few days ago

Octave version    Output device   t1        t2
==================================================
Macports 3.0.1    Aquaterm        0.64575   22
Macports 3.0.1    X11             0.41969   22
HPC      2.1.71   Aquaterm        2.7057    4
HPC      2.1.71   X11             N/A; uses Aquaterm
HPC      3.0.1    Aquaterm        0.62115   22
HPC      3.0.1    X11             N/A; defaults to Terminal.app

FWIW, Activity Monitor reports high CPU usage from gnuplot while  
waiting for the plots to appear.

Jerry


>
> My guess would be that your octave 2.1 doesn't use GnuPlot in the same
> way as the macports version of octave 3.0.
>
> This might be fixable by changing configure/build options, though. If
> we reduce the problem to the graphics backend, as I suspect is the
> case, then we can look if the graphics backend has changed for all
> octave3.0s from octave2.1s, or if this is indeed configurable, and it
> is possible to get the old plotting infrastructure back.
>
>> BTW, the first time or two that I tried to make a plot (simple, like
>> plot(x, y)) with the newly installed version of Octave from Macports,
>> it failed completely and emitted about 10 lines of Octave-related
>> errors. One or two restarts resulted in plots being made, but slowly,
>> as noted above.
>
>
> Are you able to reproduce the errors, or at least do you still have
> the corresponding octave output ? Did anything (files, paths, relaunch
> shell) change between restarts ? Are you talking about Mac OS X
> restarts, or simply exiting octave and launching it again  
> immediately ?
>
> Regards,
> -- 
> Alakazam <alakazam at melix.net>
>
> _______________________________________________
> macports-users mailing list
> macports-users at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macports-users
>



More information about the macports-users mailing list