Plotting with 3.2.0 on Windows is SLOOOOOOWWWW

1 2
Matthias Brennwald

Plotting with 3.2.0 on Windows is SLOOOOOOWWWW

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)
Dear all

Consider the following code:

-----------------
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
-----------------

Executing this with Octave 3.2.0 on my MacBook running on Mac OS X, the tic/toc timing reports about 0.06 seconds, and it takes about 1 second until all plots are displayed (using gnuplot). Doing the same on the same machine with Windows results in a tic/toc time of about 0.1 seconds, but the plots take more 5 minutes to appear.  The same happens on a 'real' Windows machine. I don't think this is how it should be, so I guess I might be doing something wrong.

I need to produce many such plots on a Windoze system. Is there anything I can do to speed things up?

Matthias


----
Matthias Brennwald
Eawag, CH-8600 Dübendorf
Office BU-C08: +41 44 823 53 05
Lab LA-C76: +41 44 823 53 06
[hidden email]



----
Matthias Brennwald, Käferholzstrasse 173, CH-8046 Zürich, +41 44 364 17 03


_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
Tatsuro MATSUOKA-2

Re: Plotting with 3.2.0 on Windows is SLOOOOOOWWWW

Reply Threaded More More options
Print post
Permalink
Hello

MMMMM It is really slow as you pointed out

On my machine, which is perhaps older machine than yours.
For the first plot,
On octave 3.2.0 on windows   it took about 6  minutes to plot.
On octave 3.2.2 on windows,  it took about 5  minutes to plot. (Built on MinGW  by myself)
On octave 3.2.0 on cygwin,   it took about 17 seconds to plot.
On octave 3.0.5 on windows,  it took about 10 seconds to plot.
On octave 3.0,3 on cygwin,   it took about 10 seconds to plot.

After plot was done, I cleared the plot by clf and tested again
On octave 3.2.0 on windows   it took about 5  minutes to plot.
On octave 3.2.2 on windows,  it took about 6  minutes to plot. (Built on MinGW  by myself)
On octave 3.2.0 on cygwin,   it took about 1  seconds to plot.
On octave 3.0.5 on windows,  it took about 3  seconds to plot.
On octave 3.0.3 on cygwin,   it took about 2  seconds to plot.

First time plot perhaps includes time to establish to connect to gnuplot.
For cygwin the time for second plots seemed to be not so slow.
For octave 3.0,5 on windows, the second plot was slower than that on cygwin but it is practical level.
However for 3.2 for windows, the plots are too slow.  The overhead time for first plot is not problem
for this issue.
 

The pipe on windows seems slower than that on Unix.
However it is too slow for octave 3.2 on MinGW.
Plot on octave 3.2.0 on cygwin is slower than that on 3.0.3 on cygwin, however the slowness within
two times and the second plot, the plot time is comparable that on octave 3.0.3.

Therefore this issue particularly is serious for octave 3.2 on windows.
Perhaps some codes newly imported in octave 3.2 gives slowness on the plot on the 3.2 for windows.

Perhaps this problem is beyond my ability, please use octave 3.0.5 on windows or octave 3.2.0 on
cygwin-1.7.

For octave 3.2, cygwin version is much stable that that on windows.  I myself do not use octave 3.2.0
on windows but use octave-3.0.5 on windows or octave 3.2,0 on cygwin-1.7.

Regards

Tatsuro
 
--- Mathias Brennwald <[hidden email]> wroten

> Dear all
>
> Consider the following code:
>
> -----------------
> 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
> -----------------
>
> Executing this with Octave 3.2.0 on my MacBook running on Mac OS X,  
> the tic/toc timing reports about 0.06 seconds, and it takes about 1  
> second until all plots are displayed (using gnuplot). Doing the same  
> on the same machine with Windows results in a tic/toc time of about  
> 0.1 seconds, but the plots take more 5 minutes to appear.  The same  
> happens on a 'real' Windows machine. I don't think this is how it  
> should be, so I guess I might be doing something wrong.
>
> I need to produce many such plots on a Windoze system. Is there  
> anything I can do to speed things up?
>
> Matthias
>
>
> ----
> Matthias Brennwald
> Eawag, CH-8600 D将臙endorf
> Office BU-C08: +41 44 823 53 05
> Lab LA-C76: +41 44 823 53 06
> [hidden email]
>
>
>
> ----
> Matthias Brennwald, K将」ferholzstrasse 173, CH-8046 Z将舐ich, +41 44 364  
> 17 03
>
> > _______________________________________________
> Help-octave mailing list
> [hidden email]
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
>


--------------------------------------
Power up the Internet with Yahoo! Toolbar.
http://pr.mail.yahoo.co.jp/toolbar/
_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
John W. Eaton-3

Re: Plotting with 3.2.0 on Windows is SLOOOOOOWWWW

Reply Threaded More More options
Print post
Permalink
On 29-Jul-2009, Tatsuro MATSUOKA wrote:

| MMMMM It is really slow as you pointed out

Is it any faster if you make the following change?  This way,
communication with gnuplot will be one-way, using popen instead of
popen2.  However, some features will be disabled (anything that
requires getting information back from the gnuplot subprocess will
likely fail).  If you can determine that using popen2 is the cause of
the performance problem, then maybe the function that needs to be
fixed is octave_popen2 in liboctave/lo-sysdep.cc.  But I'm not a
Windows expert, so I have no clue if that is correct, or if it is,
what should be done, so someone else will have to work on this
problem.

jwe


diff --git a/scripts/plot/gnuplot_drawnow.m b/scripts/plot/gnuplot_drawnow.m
--- a/scripts/plot/gnuplot_drawnow.m
+++ b/scripts/plot/gnuplot_drawnow.m
@@ -79,7 +79,7 @@
     ##  Graphics terminal for display.
     plot_stream = get (h, "__plot_stream__");
     if (isempty (plot_stream))
-      plot_stream = __gnuplot_open_stream__ (2, h);
+      plot_stream = __gnuplot_open_stream__ (1, h);
       new_stream = true;
     else
       new_stream = false;

_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
Tatsuro MATSUOKA-2

Re: Plotting with 3.2.0 on Windows is SLOOOOOOWWWW

Reply Threaded More More options
Print post
Permalink
In reply to this post by Tatsuro MATSUOKA-2
Hello

Hmmmmm!

The slowness seem to strongly depends on the system.

In the test previous post performed on the computer in my home (Windows XP home Cereron M 1.2Ghz 512Mb
Memory).
I have tested the same tests by Matthias Brennwald on the computer the university (Windows XP
professionan HT Pentium 3.4GHz 1GB Memory)

The speed of the tests on the octave 3.2 (3.2.0 MinGW distributed on the OctaveForge and Octave 3.2.2
built myself)is comparable to octave 3.0.5 MinGW distributed on the OctaveForge).
Of course the result for 3.0.5 is faster than that ion the computer in mu home.  However it is
reasonable to the different in CPU performance.  However the difference octave 3.2 on MinGW is too big
to attribute the cpu performance.

 
Note that I do not use John's patch for this test.

For the computer in my university, the John's patch seem to be not needed.
I will test again when I return to my home.

Hello Matthias Brennwald

Can you perform the test with John's patch by yourself?

Regards

Tatsuro

 
--- Tatsuro MATSUOKA  wrote:

> Hello
>
> MMMMM It is really slow as you pointed out
>
> On my machine, which is perhaps older machine than yours.
> For the first plot,
> On octave 3.2.0 on windows   it took about 6  minutes to plot.
> On octave 3.2.2 on windows,  it took about 5  minutes to plot. (Built on MinGW  by myself)
> On octave 3.2.0 on cygwin,   it took about 17 seconds to plot.
> On octave 3.0.5 on windows,  it took about 10 seconds to plot.
> On octave 3.0,3 on cygwin,   it took about 10 seconds to plot.
>
> After plot was done, I cleared the plot by clf and tested again
> On octave 3.2.0 on windows   it took about 5  minutes to plot.
> On octave 3.2.2 on windows,  it took about 6  minutes to plot. (Built on MinGW  by myself)
> On octave 3.2.0 on cygwin,   it took about 1  seconds to plot.
> On octave 3.0.5 on windows,  it took about 3  seconds to plot.
> On octave 3.0.3 on cygwin,   it took about 2  seconds to plot.
>
> First time plot perhaps includes time to establish to connect to gnuplot.
> For cygwin the time for second plots seemed to be not so slow.
> For octave 3.0,5 on windows, the second plot was slower than that on cygwin but it is practical
> level.
> However for 3.2 for windows, the plots are too slow.  The overhead time for first plot is not
> problem
> for this issue.
>  
>
> The pipe on windows seems slower than that on Unix.
> However it is too slow for octave 3.2 on MinGW.
> Plot on octave 3.2.0 on cygwin is slower than that on 3.0.3 on cygwin, however the slowness
> within
> two times and the second plot, the plot time is comparable that on octave 3.0.3.
>
> Therefore this issue particularly is serious for octave 3.2 on windows.
> Perhaps some codes newly imported in octave 3.2 gives slowness on the plot on the 3.2 for
> windows.
>
> Perhaps this problem is beyond my ability, please use octave 3.0.5 on windows or octave 3.2.0 on
> cygwin-1.7.
>
> For octave 3.2, cygwin version is much stable that that on windows.  I myself do not use octave
> 3.2.0
> on windows but use octave-3.0.5 on windows or octave 3.2,0 on cygwin-1.7.
>
> Regards
>
> Tatsuro
>  
> --- Mathias Brennwald <[hidden email]> wroten
>
> > Dear all
> >
> > Consider the following code:
> >
> > -----------------
> > 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
> > -----------------
> >
> > Executing this with Octave 3.2.0 on my MacBook running on Mac OS X,  
> > the tic/toc timing reports about 0.06 seconds, and it takes about 1  
> > second until all plots are displayed (using gnuplot). Doing the same  
> > on the same machine with Windows results in a tic/toc time of about  
> > 0.1 seconds, but the plots take more 5 minutes to appear.  The same  
> > happens on a 'real' Windows machine. I don't think this is how it  
> > should be, so I guess I might be doing something wrong.
> >
> > I need to produce many such plots on a Windoze system. Is there  
> > anything I can do to speed things up?
> >
> > Matthias
> >
> >
> > ----
> > Matthias Brennwald
> > Eawag, CH-8600 D将臙endorf
> > Office BU-C08: +41 44 823 53 05
> > Lab LA-C76: +41 44 823 53 06
> > [hidden email]
> >
> >
> >
> > ----
> > Matthias Brennwald, K将」ferholzstrasse 173, CH-8046 Z将舐ich, +41 44 364  
> > 17 03
> >
> > > _______________________________________________
> > Help-octave mailing list
> > [hidden email]
> > https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
> >
>
>
> --------------------------------------
> Power up the Internet with Yahoo! Toolbar.
> http://pr.mail.yahoo.co.jp/toolbar/
> _______________________________________________
> Help-octave mailing list
> [hidden email]
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
>



--------------------------------------
Power up the Internet with Yahoo! Toolbar.
http://pr.mail.yahoo.co.jp/toolbar/
_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
Tatsuro MATSUOKA-2

Re: Plotting with 3.2.0 on Windows is SLOOOOOOWWWW

Reply Threaded More More options
Print post
Permalink
Hello Matthias Brennwald

The issue seems to be system denependent (Machine Spec.(kind of CPU, amount of memory),
OS (e.g. XP home, XP Professional, Vista Home Premium etc. ).

Please make sure at that point in your reply.

Regards

Tatsuro


--- Tatsuro MATSUOKA  wrote:

> Hello
>
> Hmmmmm!
>
> The slowness seem to strongly depends on the system.
>
> In the test previous post performed on the computer in my home (Windows XP home Cereron M 1.2Ghz
> 512Mb
> Memory).
> I have tested the same tests by Matthias Brennwald on the computer the university (Windows XP
> professionan HT Pentium 3.4GHz 1GB Memory)
>
> The speed of the tests on the octave 3.2 (3.2.0 MinGW distributed on the OctaveForge and Octave
> 3.2.2
> built myself)is comparable to octave 3.0.5 MinGW distributed on the OctaveForge).
> Of course the result for 3.0.5 is faster than that ion the computer in mu home.  However it is
> reasonable to the different in CPU performance.  However the difference octave 3.2 on MinGW is
> too big
> to attribute the cpu performance.
>
>  
> Note that I do not use John's patch for this test.
>
> For the computer in my university, the John's patch seem to be not needed.
> I will test again when I return to my home.
>
> Hello Matthias Brennwald
>
> Can you perform the test with John's patch by yourself?
>
> Regards
>
> Tatsuro
>
>  
> --- Tatsuro MATSUOKA  wrote:
>
> > Hello
> >
> > MMMMM It is really slow as you pointed out
> >
> > On my machine, which is perhaps older machine than yours.
> > For the first plot,
> > On octave 3.2.0 on windows   it took about 6  minutes to plot.
> > On octave 3.2.2 on windows,  it took about 5  minutes to plot. (Built on MinGW  by myself)
> > On octave 3.2.0 on cygwin,   it took about 17 seconds to plot.
> > On octave 3.0.5 on windows,  it took about 10 seconds to plot.
> > On octave 3.0,3 on cygwin,   it took about 10 seconds to plot.
> >
> > After plot was done, I cleared the plot by clf and tested again
> > On octave 3.2.0 on windows   it took about 5  minutes to plot.
> > On octave 3.2.2 on windows,  it took about 6  minutes to plot. (Built on MinGW  by myself)
> > On octave 3.2.0 on cygwin,   it took about 1  seconds to plot.
> > On octave 3.0.5 on windows,  it took about 3  seconds to plot.
> > On octave 3.0.3 on cygwin,   it took about 2  seconds to plot.
> >
> > First time plot perhaps includes time to establish to connect to gnuplot.
> > For cygwin the time for second plots seemed to be not so slow.
> > For octave 3.0,5 on windows, the second plot was slower than that on cygwin but it is
> practical
> > level.
> > However for 3.2 for windows, the plots are too slow.  The overhead time for first plot is not
> > problem
> > for this issue.
> >  
> >
> > The pipe on windows seems slower than that on Unix.
> > However it is too slow for octave 3.2 on MinGW.
> > Plot on octave 3.2.0 on cygwin is slower than that on 3.0.3 on cygwin, however the slowness
> > within
> > two times and the second plot, the plot time is comparable that on octave 3.0.3.
> >
> > Therefore this issue particularly is serious for octave 3.2 on windows.
> > Perhaps some codes newly imported in octave 3.2 gives slowness on the plot on the 3.2 for
> > windows.
> >
> > Perhaps this problem is beyond my ability, please use octave 3.0.5 on windows or octave 3.2.0
> on
> > cygwin-1.7.
> >
> > For octave 3.2, cygwin version is much stable that that on windows.  I myself do not use
> octave
> > 3.2.0
> > on windows but use octave-3.0.5 on windows or octave 3.2,0 on cygwin-1.7.
> >
> > Regards
> >
> > Tatsuro
> >  
> > --- Mathias Brennwald <[hidden email]> wroten
> >
> > > Dear all
> > >
> > > Consider the following code:
> > >
> > > -----------------
> > > 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
> > > -----------------
> > >
> > > Executing this with Octave 3.2.0 on my MacBook running on Mac OS X,  
> > > the tic/toc timing reports about 0.06 seconds, and it takes about 1  
> > > second until all plots are displayed (using gnuplot). Doing the same  
> > > on the same machine with Windows results in a tic/toc time of about  
> > > 0.1 seconds, but the plots take more 5 minutes to appear.  The same  
> > > happens on a 'real' Windows machine. I don't think this is how it  
> > > should be, so I guess I might be doing something wrong.
> > >
> > > I need to produce many such plots on a Windoze system. Is there  
> > > anything I can do to speed things up?
> > >
> > > Matthias
> > >
> > >
> > > ----
> > > Matthias Brennwald
> > > Eawag, CH-8600 D将臙endorf
> > > Office BU-C08: +41 44 823 53 05
> > > Lab LA-C76: +41 44 823 53 06
> > > [hidden email]
> > >
> > >
> > >
> > > ----
> > > Matthias Brennwald, K将」ferholzstrasse 173, CH-8046 Z将舐ich, +41 44 364  
> > > 17 03
> > >
> > > > _______________________________________________
> > > Help-octave mailing list
> > > [hidden email]
> > > https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
> > >
> >
> >
> > --------------------------------------
> > Power up the Internet with Yahoo! Toolbar.
> > http://pr.mail.yahoo.co.jp/toolbar/
> > _______________________________________________
> > Help-octave mailing list
> > [hidden email]
> > https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
> >
>
>
>
> --------------------------------------
> Power up the Internet with Yahoo! Toolbar.
> http://pr.mail.yahoo.co.jp/toolbar/
>


--------------------------------------
Power up the Internet with Yahoo! Toolbar.
http://pr.mail.yahoo.co.jp/toolbar/
_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
Matthias Brennwald-2

Re: Plotting with 3.2.0 on Windows is SLOOOOOOWWWW

Reply Threaded More More options
Print post
Permalink
On Jul 29, 2009, at 2:17 AM, Tatsuro MATSUOKA wrote:

> Hello
>
> Hmmmmm!
>
> The slowness seem to strongly depends on the system.
>
> In the test previous post performed on the computer in my home  
> (Windows XP home Cereron M 1.2Ghz 512Mb
> Memory).
> I have tested the same tests by Matthias Brennwald on the computer  
> the university (Windows XP
> professionan HT Pentium 3.4GHz 1GB Memory)
>
> The speed of the tests on the octave 3.2 (3.2.0 MinGW distributed on  
> the OctaveForge and Octave 3.2.2
> built myself)is comparable to octave 3.0.5 MinGW distributed on the  
> OctaveForge).
> Of course the result for 3.0.5 is faster than that ion the computer  
> in mu home.  However it is
> reasonable to the different in CPU performance.  However the  
> difference octave 3.2 on MinGW is too big
> to attribute the cpu performance.
>
>
> Note that I do not use John's patch for this test.
>
> For the computer in my university, the John's patch seem to be not  
> needed.
> I will test again when I return to my home.
>
> Hello Matthias Brennwald
>
> Can you perform the test with John's patch by yourself?
>
> Regards
>
> Tatsuro

I don't think I am able to add this patch and recompile Octave myself  
on Windows. I am an absolute idiot when it comes to Windows, and I  
have never compiled anything on this platform. I don't even know what  
compilers and IDEs there are. So, I'd be very grateful if someone else  
with more experience could try this.

On Jul 29, 2009, at 6:02 AM, Tatsuro MATSUOKA wrote:

> Hello Matthias Brennwald
>
> The issue seems to be system denependent (Machine Spec.(kind of CPU,  
> amount of memory),
> OS (e.g. XP home, XP Professional, Vista Home Premium etc. ).
>
> Please make sure at that point in your reply.
>
> Regards
>
> Tatsuro

Thanks for pointing this out. Again, as I wrote above, I don't know  
much about Windows. All I know is that I have Windows XP. How do I  
tell which variant I have (home, Professional, whatever)? [Quick rant:  
I am using this at home, working for my job. So this should probably  
be home-professional or something. Rant off.]

I use two Windows machines, and I observed the slowness on both. The  
first is the machine in my laboratory (a Pentium-4 with about 2GHz and  
256MB memory, which I'll try to upgrade to 4GB) and the virtual  
machine running on my MacBook Pro (Core-2-duo at at 2.8 GHz, with the  
memory of the virtual machine set to 512 MB).

As a quick work around I thought I'd try the fltk plotting backend.  
This is MUCH faster. However, the fltk backend is not a useful  
alternative yet, because it does not handle text objects (axis labels,  
legends, plot titles).

Thanks for your help
Matthias

_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
John W. Eaton-3

Re: Plotting with 3.2.0 on Windows is SLOOOOOOWWWW

Reply Threaded More More options
Print post
Permalink
On 29-Jul-2009, Matthias Brennwald wrote:

| On Jul 29, 2009, at 2:17 AM, Tatsuro MATSUOKA wrote:
|
| > Hello
| >
| > Hmmmmm!
| >
| > The slowness seem to strongly depends on the system.
| >
| > In the test previous post performed on the computer in my home  
| > (Windows XP home Cereron M 1.2Ghz 512Mb
| > Memory).
| > I have tested the same tests by Matthias Brennwald on the computer  
| > the university (Windows XP
| > professionan HT Pentium 3.4GHz 1GB Memory)
| >
| > The speed of the tests on the octave 3.2 (3.2.0 MinGW distributed on  
| > the OctaveForge and Octave 3.2.2
| > built myself)is comparable to octave 3.0.5 MinGW distributed on the  
| > OctaveForge).
| > Of course the result for 3.0.5 is faster than that ion the computer  
| > in mu home.  However it is
| > reasonable to the different in CPU performance.  However the  
| > difference octave 3.2 on MinGW is too big
| > to attribute the cpu performance.
| >
| >
| > Note that I do not use John's patch for this test.
| >
| > For the computer in my university, the John's patch seem to be not  
| > needed.
| > I will test again when I return to my home.
| >
| > Hello Matthias Brennwald
| >
| > Can you perform the test with John's patch by yourself?
| >
| > Regards
| >
| > Tatsuro
|
| I don't think I am able to add this patch and recompile Octave myself  
| on Windows. I am an absolute idiot when it comes to Windows, and I  
| have never compiled anything on this platform. I don't even know what  
| compilers and IDEs there are. So, I'd be very grateful if someone else  
| with more experience could try this.

The change I sent was a single character change to one .m file.  You
don't need to recompile Octave to test it.  Just edit the file
gnuplot_drawnow.m and change the second occurrence of

  plot_stream = __gnuplot_open_stream__ (2, h);

to

  plot_stream = __gnuplot_open_stream__ (1, h);

then restart Octave and try your plotting command again.  Is it
faster?  I'd be surprised if it is, but some obscure difference in the
way that popen2 vs. popen is connecting to gnuplot is the only thing I
can think of at the moment that might cause a difference in the speed
of plotting.  But this is just a guess.

jwe
_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
Thomas Weber-8

Re: Plotting with 3.2.0 on Windows is SLOOOOOOWWWW

Reply Threaded More More options
Print post
Permalink
In reply to this post by Matthias Brennwald-2
On Wed, Jul 29, 2009 at 08:05:19AM +0200, Matthias Brennwald wrote:

> > Hello Matthias Brennwald
> >
> > The issue seems to be system denependent (Machine Spec.(kind of CPU,  
> > amount of memory),
> > OS (e.g. XP home, XP Professional, Vista Home Premium etc. ).
> >
> > Please make sure at that point in your reply.
> >
> > Regards
> >
> > Tatsuro
>
> Thanks for pointing this out. Again, as I wrote above, I don't know  
> much about Windows. All I know is that I have Windows XP. How do I  
> tell which variant I have (home, Professional, whatever)? [Quick rant:  
> I am using this at home, working for my job. So this should probably  
> be home-professional or something. Rant off.]

The main difference between XP Home and Professional is the availibility
of administrative tools, ie stuff that makes your life in administering
these systems easier.

http://technet.microsoft.com/en-us/library/bb457127.aspx
http://www-pc.uni-regensburg.de/systemsw/WinXP/xphome1.htm
[sorry, german for the second link]

Martin, you can find the information by right-clicking on "Arbeitsplatz"
on your desktop and choosing "Eigenschaften". Go to the "Allgemein" Tab.

Sorry for using the German words, but I don't know the English ones
right now.
Screenshots:
http://www.fz-juelich.de/jsc/files/net/security/inf-xp/xp-arbeitsplatz-eigen.htm

Different way of doing this:
http://www.edv-buchversand.de/f-secure/url.php?cnt=faq#A1_3

        Thomas
_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
Francesco Potortì

Re: Plotting with 3.2.0 on Windows is SLOOOOOOWWWW

Reply Threaded More More options
Print post
Permalink
In reply to this post by Tatsuro MATSUOKA-2
>The slowness seem to strongly depends on the system.
>
>In the test previous post performed on the computer in my home (Windows
>XP home Cereron M 1.2Ghz 512Mb Memory).  I have tested the same tests
>by Matthias Brennwald on the computer the university (Windows XP
>professionan HT Pentium 3.4GHz 1GB Memory)
>
>The speed of the tests on the octave 3.2 (3.2.0 MinGW distributed on
>the OctaveForge and Octave 3.2.2 built myself)is comparable to octave
>3.0.5 MinGW distributed on the OctaveForge).  Of course the result for
>3.0.5 is faster than that ion the computer in mu home.  However it is
>reasonable to the different in CPU performance.  However the difference
>octave 3.2 on MinGW is too big to attribute the cpu performance.

I have not understood the last paragraph, however the memory amount
between the two systems (512M versus 1G) could make a significant
difference, if the working set of the kernel, octave and gnuplot exceeds
512MB.

--
Francesco Potortì (ricercatore)        Voice: +39 050 315 3058 (op.2111)
ISTI - Area della ricerca CNR          Fax:   +39 050 315 2040
via G. Moruzzi 1, I-56124 Pisa         Email: [hidden email]
(entrance 20, 1st floor, room C71)     Web:   http://fly.isti.cnr.it/
_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
Tatsuro MATSUOKA-2

Re: Plotting with 3.2.0 on Windows is SLOOOOOOWWWW

Reply Threaded More More options
Print post
Permalink
Hello

--- Francesco Potorti`  wrote:

>
> I have not understood the last paragraph, however the memory amount
> between the two systems (512M versus 1G) could make a significant
> difference, if the working set of the kernel, octave and gnuplot exceeds
> 512MB.
>

It is possible. However the slowness did not occur on octave 3.2.0 on cygwin-1.7.  

See
http://www.nabble.com/Re:-Plotting-with-3.2.0-on-Windows-is-SLOOOOOOWWWW-p24706929.html

Do you think that Octave 3.2.0 on cygwin uses smaller size of memory than that by octave 3.2.0 native
to windows (octave built by MinGW) ?

I cannot deny the possibility at the moment.

Anyway I would like to test John's patch at the computer in my home.

Regards

Tatsuro  

--------------------------------------
Power up the Internet with Yahoo! Toolbar.
http://pr.mail.yahoo.co.jp/toolbar/
_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
Francesco Potortì

Re: Plotting with 3.2.0 on Windows is SLOOOOOOWWWW

Reply Threaded More More options
Print post
Permalink
>> I have not understood the last paragraph, however the memory amount
>> between the two systems (512M versus 1G) could make a significant
>> difference, if the working set of the kernel, octave and gnuplot exceeds
>> 512MB.
>
>It is possible. However the slowness did not occur on octave 3.2.0 on cygwin-1.7.  

Allright, I had not understood this, in fact.

>Do you think that Octave 3.2.0 on cygwin uses smaller size of memory
>than that by octave 3.2.0 native to windows (octave built by MinGW) ?

No idea.

--
Francesco Potortì (ricercatore)        Voice: +39 050 315 3058 (op.2111)
ISTI - Area della ricerca CNR          Fax:   +39 050 315 2040
via G. Moruzzi 1, I-56124 Pisa         Email: [hidden email]
(entrance 20, 1st floor, room C71)     Web:   http://fly.isti.cnr.it/
_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
Tatsuro MATSUOKA-2

Re: Plotting with 3.2.0 on Windows is SLOOOOOOWWWW

Reply Threaded More More options
Print post
Permalink
In reply to this post by John W. Eaton-3
Hello

--- "John W. Eaton"  wrote:

> On 29-Jul-2009, Tatsuro MATSUOKA wrote:
>
> | MMMMM It is really slow as you pointed out
>
> Is it any faster if you make the following change?  This way,
> communication with gnuplot will be one-way, using popen instead of
> popen2.  However, some features will be disabled (anything that
> requires getting information back from the gnuplot subprocess will
> likely fail).  If you can determine that using popen2 is the cause of
> the performance problem, then maybe the function that needs to be
> fixed is octave_popen2 in liboctave/lo-sysdep.cc.  But I'm not a
> Windows expert, so I have no clue if that is correct, or if it is,
> what should be done, so someone else will have to work on this
> problem.
>
> jwe
>
> > diff --git a/scripts/plot/gnuplot_drawnow.m b/scripts/plot/gnuplot_drawnow.m
> --- a/scripts/plot/gnuplot_drawnow.m
> +++ b/scripts/plot/gnuplot_drawnow.m
> @@ -79,7 +79,7 @@
>      ##  Graphics terminal for display.
>      plot_stream = get (h, "__plot_stream__");
>      if (isempty (plot_stream))
> -      plot_stream = __gnuplot_open_stream__ (2, h);
> +      plot_stream = __gnuplot_open_stream__ (1, h);
>        new_stream = true;
>      else
>        new_stream = false;
>
The above change gives errors;

error: __gnuplot_get_var__: Need mkfifo that is not implemented under Windows
error: called from:
error:   C:\Programs\Octave\3.2.0_gcc-4.3.0\share\octave\3.2.0\m\plot\__gnuplot_get_var__.m at line
52, column 7
error:   C:\Programs\Octave\3.2.0_gcc-4.3.0\share\octave\3.2.0\m\plot\__go_draw_axes__.m at line 39,
column 18
error: __gnuplot_get_var__: Need mkfifo that is not implemented under Windows
error: called from:
error:   C:\Programs\Octave\3.2.0_gcc-4.3.0\share\octave\3.2.0\m\plot\__gnuplot_get_var__.m at line
52, column 7
error:   C:\Programs\Octave\3.2.0_gcc-4.3.0\share\octave\3.2.0\m\plot\__go_draw_axes__.m at line 39,
column 18
error: __gnuplot_get_var__: Need mkfifo that is not implemented under Windows
error: called from:
error:   C:\Programs\Octave\3.2.0_gcc-4.3.0\share\octave\3.2.0\m\plot\__gnuplot_get_var__.m at line
52, column 7
error:   C:\Programs\Octave\3.2.0_gcc-4.3.0\share\octave\3.2.0\m\plot\__go_draw_axes__.m at line 39,
column 18
error: __gnuplot_get_var__: Need mkfifo that is not implemented under Windows
error: called from:
error:   C:\Programs\Octave\3.2.0_gcc-4.3.0\share\octave\3.2.0\m\plot\__gnuplot_get_var__.m at line
52, column 7
error:   C:\Programs\Octave\3.2.0_gcc-4.3.0\share\octave\3.2.0\m\plot\__go_draw_axes__.m at line 39,
column 18

About a year before I have tried to use cygwin's gnuplot for windows octave.  In the case, the speed
of plot with drawnow in a for loop of gnuplot on cygwin is faster that that of gnuplot for windows.  I
suppose that some  optimizing treatments are carried out in the emulation layer of the posix pipe in
cygwin.

However I have not carried out enough investigation on this matter.  I would like to think about this
issue for a while.  My idea at present is that it will be required to treat the code of octave_popen2
in liboctave/lo-sysdep.cc using the win32 pipe functions but not the posix compatible ones.

Anyway please give me a moment for this matter but I cannot assure that my trial will be successful.

Hi Matthias Brennwald

Have to you use octave 3.2.0 on windows ?  At the moment it is better to use octave 3.0.5 on mingw
unless you need to use new features on the octave 3.2.0.

http://sourceforge.net/projects/octave/files/Octave_Windows%20-%20MinGW/Octave%203.0.5%20for%20Windows%20MinGW32%20Installer/Octave-3.0.5_i686-pc-mingw32_gcc-4.3.0_setup.exe


If you have to use octave 3.2.0, I recommend to try octave-3.2.0 on cygwin-1.7.

Please see the details at  
http://wiki.octave.org/wiki.pl?OctaveForWindows

Regards

Tatsuro  

--------------------------------------
Power up the Internet with Yahoo! Toolbar.
http://pr.mail.yahoo.co.jp/toolbar/
_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
John W. Eaton-3

Re: Plotting with 3.2.0 on Windows is SLOOOOOOWWWW

Reply Threaded More More options
Print post
Permalink
On 30-Jul-2009, Tatsuro MATSUOKA wrote:

| The above change gives errors;
|
| error: __gnuplot_get_var__: Need mkfifo that is not implemented under Windows
| error: called from:
| error:   C:\Programs\Octave\3.2.0_gcc-4.3.0\share\octave\3.2.0\m\plot\__gnuplot_get_var__.m at line
| 52, column 7

OK, so the current plotting scripts actually require 2-way
communication with gnuplot to do anything useful.  So I guess you'll
need to debug this problem in some other way.

jwe
_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
Tatsuro MATSUOKA-2

Re: Plotting with 3.2.0 on Windows is SLOOOOOOWWWW

Reply Threaded More More options
Print post
Permalink
Hello

**For tracking this issue,
http://www.nabble.com/Plotting-with-3.2.0-on-Windows-is-SLOOOOOOWWWW-td24703690.html

***********
I have got a great hint to overcome this issue.  

I have changed pipe buffer size of CreatPipe in octave_popen2 .  The times of he Disk access was
reduced however no speed up is observed.  

Today I have !!!!suddenly!!!! gotten an idea the gnuplot process may be very slow. Then it I pressed
CTRL+ALT+DEL keys and execute the windows task manager.  

When the following  command executing,
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

octave-3.2.0 occupied 99% cpu activity and thus I guessed that the speed gnuplot made slower and thus
led to slooooow plotting.  

Next before the above command by Matthias Brennwald I have execute the following command on
octave-3.2.0.

fplot(@sin, [0 2*pi])

After that I pressed CTRL+ALT+DEL keys and execute the task manager, selected 'Process' tab, and found
the process of gnuplot.exe.  Then I clicked gnuplot.exe by a right mouse button and change priority of
the process of gnuplot to be increased by one grade.

The above priority setting gave 2 second for the whole plotting by the command of Matthias Brennwald.

The reason why the slowness did not occur in the computer in my university may come from that the cpu
of the computer is hyper-threaded so that even if 1 logical core occupied by octave process, the
gnuplot can work at enough speed the otherlogical cpu.

If one can control process priority of the child process (in this case of gnuplot) can be controled  
.

In the case of the cygwin the child process via pipe may be given higher priority than that in
windows.    

The stories the above have not been completely proved but the results give us important hint to
overcome this issue.

I will consult Microsoft pages for windows API functions and consider the patch.

Comments to this post are highly appreciated.

Regards

Tatsuro


--- "John W. Eaton" wrote:

> On 30-Jul-2009, Tatsuro MATSUOKA wrote:
>
> | The above change gives errors;
> |
> | error: __gnuplot_get_var__: Need mkfifo that is not implemented under Windows
> | error: called from:
> | error:   C:\Programs\Octave\3.2.0_gcc-4.3.0\share\octave\3.2.0\m\plot\__gnuplot_get_var__.m at
> line
> | 52, column 7
>
> OK, so the current plotting scripts actually require 2-way
> communication with gnuplot to do anything useful.  So I guess you'll
> need to debug this problem in some other way.
>
> jwe
>


--------------------------------------
Power up the Internet with Yahoo! Toolbar.
http://pr.mail.yahoo.co.jp/toolbar/
_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
Tatsuro MATSUOKA-2

Re: Plotting with 3.2.0 on Windows is SLOOOOOOWWWW

Reply Threaded More More options
Print post
Permalink
Hello

I have made a patch to lo-sysdep.cc at the end of file. For the example by Matthiaas Brennwldd

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

Time for plot is about 8 seconds and 2 second after that.
(CPU CeleronM 1.3GHz, XP home 512 MB Memory).
Before patch it took 5-7 minutes!!! Too slow.

However, is it reanable each child process created by octave_popen2 always has
ABOVE_NORMAL_PRIORITY_CLASS?  

The slowness at this time occurred because the octave-3.2.0 is heavy task for 1 core system, which
share almost all cpu activities.  

I cannot judge this patch is appropriate so that I would like to heart the opinion by those who are
much experience and knowledge for the windows programing.

Regards

Tatsuro



**************************
--- a/liboctave/lo-sysdep.cc 2009-05-25 15:04:58 +0900
+++ b/liboctave/lo-sysdep.cc 2009-08-01 15:48:55 +0900
@@ -159,6 +159,7 @@
       msg = "popen2: process creation failed";
       return -1;
     }
+  SetPriorityClass(pi.hProcess, ABOVE_NORMAL_PRIORITY_CLASS);
   pid = pi.dwProcessId;
 
   CloseHandle (childRead);




--------------------------------------
Power up the Internet with Yahoo! Toolbar.
http://pr.mail.yahoo.co.jp/toolbar/
_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
Tatsuro MATSUOKA-2

Re: Plotting with 3.2.0 on Windows is SLOOOOOOWWWW

Reply Threaded More More options
Print post
Permalink
In reply to this post by Matthias Brennwald
Hello

The patch I have cosidered for octave_popen2 in iboctave/losyspep.cc

See

http://www.nabble.com/Re:-Plotting-with-3.2.0-on-Windows-is-SLOOOOOOWWWW-p24766712.html

For the convenience to understand this problem I show the code of patched octave_popen2 function.  

**********
pid_t
octave_popen2 (const std::string& cmd, const string_vector& args, bool sync_mode,
    int *fildes, std::string& msg)
{
  pid_t pid;
  PROCESS_INFORMATION pi;
  STARTUPINFO si;
  std::string command = "\"" + cmd + "\"";
  HANDLE hProcess = GetCurrentProcess(), childRead, childWrite, parentRead, parentWrite;
  DWORD pipeMode;

  ZeroMemory (&pi, sizeof (pi));
  ZeroMemory (&si, sizeof (si));
  si.cb = sizeof (si);

  if (! CreatePipe (&childRead, &parentWrite, 0, 65536) ||
      ! DuplicateHandle (hProcess, childRead, hProcess, &childRead, 0, TRUE, DUPLICATE_SAME_ACCESS |
DUPLICATE_CLOSE_SOURCE))
    {
      msg = "popen2: pipe creation failed";
      return -1;
    }
  if (! CreatePipe (&parentRead, &childWrite, 0, 0) ||
      ! DuplicateHandle (hProcess, childWrite, hProcess, &childWrite, 0, TRUE, DUPLICATE_SAME_ACCESS |
DUPLICATE_CLOSE_SOURCE))
    {
      msg = "popen2: pipe creation failed";
      return -1;
    }
  if (! sync_mode)
    {
      pipeMode = PIPE_NOWAIT;
      SetNamedPipeHandleState (parentRead, &pipeMode, 0, 0);
    }
  fildes[1] = _open_osfhandle (reinterpret_cast<long> (parentRead), _O_RDONLY | _O_BINARY);
  fildes[0] = _open_osfhandle (reinterpret_cast<long> (parentWrite), _O_WRONLY | _O_BINARY);
  si.dwFlags |= STARTF_USESTDHANDLES;
  si.hStdInput = childRead;
  si.hStdOutput = childWrite;

  // Ignore first arg as it is the command
  for (int k=1; k<args.length(); k++)
    command += " \"" + args[k] + "\"";
  OCTAVE_LOCAL_BUFFER (char, c_command, command.length () + 1);
  strcpy (c_command, command.c_str ());
  if (! CreateProcess (0, c_command, 0, 0, TRUE, 0, 0, 0, &si, &pi))
    {
      msg = "popen2: process creation failed";
      return -1;
    }
  SetPriorityClass(pi.hProcess, ABOVE_NORMAL_PRIORITY_CLASS); // added line
  pid = pi.dwProcessId;

  CloseHandle (childRead);
  CloseHandle (childWrite);
  CloseHandle (pi.hProcess);
  CloseHandle (pi.hThread);

  return pid;
}
*******************

  SetPriorityClass(pi.hProcess, ABOVE_NORMAL_PRIORITY_CLASS); // added line

This make the child process has always has the absolute higher priority class.
If the parent process is octave and child process is gnuplot this is realistic.
However in general sense I have an anxiety for this simple patch
   
Your code is worth to be examined.

Thanks!!

Tatsuro

--- Saarela Olli wrote:

> Hi,
>
> > octave-3.2.0 occupied 99% cpu activity and thus I guessed that
> > the speed gnuplot made slower and thus led to slooooow plotting.
>
> Such symptoms can arise if the lack of select() in Windows is worked around with something like
>
>   time_t now = time(NULL);
>   while (time(NULL) < now + timeout) {
>     PeekNamedPipe(read_handle, NULL, 0, NULL, &len, NULL));
>     if (len > 0) // data is available
>       break;
>   }
>
> which would consume all available CPU time until the program at the other end of the pipe has
> written something.  If this is the case, instead of treating the symptoms with changed process
> priorities you might want to go closer to the root cause by adding a short sleep to the code,
> e.g.,
>
>   DWORD sleeptime = 1; // 1 millisecond
>   time_t now = time(NULL);
>   while (time(NULL) < now + timeout) {
>     PeekNamedPipe(read_handle, NULL, 0, NULL, &len, NULL));
>     if (len > 0) // data is available
>       break;
>     Sleep(sleeptime);
>     if (sleeptime < 64)
>        sleeptime *= 2;
>   }
>
> I don't know my way around Octave's C++ sources and couldn't find PeekNamedPipe in them, so I
> don't really know if this is the case. The actual loop structure (if any) could involve calling
> several functions and instead of PeekNamedPipe can, e.g., call an unblocking read. Anyway, I
> hope this helps debugging.
>
> Cheers, Olli
>
>


--------------------------------------
Power up the Internet with Yahoo! Toolbar.
http://pr.mail.yahoo.co.jp/toolbar/
_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
Olli Saarela-2

Re: Plotting with 3.2.0 on Windows is SLOOOOOOWWWW

Reply Threaded More More options
Print post
Permalink
In reply to this post by Matthias Brennwald
Hi,

> octave-3.2.0 occupied 99% cpu activity and thus I guessed that
> the speed gnuplot made slower and thus led to slooooow plotting.

Such symptoms can arise if the lack of select() in Windows is worked
around with something like

  time_t now = time(NULL);
  while (time(NULL) < now + timeout) {
    PeekNamedPipe(read_handle, NULL, 0, NULL, &len, NULL));
    if (len > 0) // data is available
      break;
  }

which would consume all available CPU time until the program at the
other end of the pipe has written something.  If this is the case,
instead of treating the symptoms with changed process priorities you
might want to go closer to the root cause by adding a short sleep to
the code, e.g.,

  DWORD sleeptime = 1; // 1 millisecond
  time_t now = time(NULL);
  while (time(NULL) < now + timeout) {
    PeekNamedPipe(read_handle, NULL, 0, NULL, &len, NULL));
    if (len > 0) // data is available
      break;
    Sleep(sleeptime);
    if (sleeptime < 64)
       sleeptime *= 2;
  }

I don’t know my way around Octave’s C++ sources and couldn’t find
PeekNamedPipe in them, so I don’t really know if this is the case. The
actual loop structure (if any) could involve calling several functions
and instead of PeekNamedPipe can, e.g., call an unblocking read.
Anyway, I hope this helps debugging.

Cheers, Olli

_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
Olli Saarela-2

RE: Plotting with 3.2.0 on Windows is SLOOOOOOWWWW

Reply Threaded More More options
Print post
Permalink
In reply to this post by Matthias Brennwald
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.

Cheers, Olli


> -----Original Message-----
> From: Tatsuro MATSUOKA [mailto:[hidden email]]
> Sent: 3. elokuuta 2009 12:16
> To: Saarela Olli
> Cc: [hidden email]
> Subject: Re: Plotting with 3.2.0 on Windows is SLOOOOOOWWWW
>
> Hello
>
> The patch I have cosidered for octave_popen2 in iboctave/losyspep.cc
>
> See
>
> http://www.nabble.com/Re:-Plotting-with-3.2.0-on-Windows-is-
> SLOOOOOOWWWW-p24766712.html
>
> For the convenience to understand this problem I show the code of
> patched octave_popen2 function.
>
> **********
> pid_t
> octave_popen2 (const std::string& cmd, const string_vector& args, bool
> sync_mode,
>     int *fildes, std::string& msg)
> {
>   pid_t pid;
>   PROCESS_INFORMATION pi;
>   STARTUPINFO si;
>   std::string command = "\"" + cmd + "\"";
>   HANDLE hProcess = GetCurrentProcess(), childRead, childWrite,
> parentRead, parentWrite;
>   DWORD pipeMode;
>
>   ZeroMemory (&pi, sizeof (pi));
>   ZeroMemory (&si, sizeof (si));
>   si.cb = sizeof (si);
>
>   if (! CreatePipe (&childRead, &parentWrite, 0, 65536) ||
>       ! DuplicateHandle (hProcess, childRead, hProcess, &childRead, 0,
> TRUE, DUPLICATE_SAME_ACCESS |
> DUPLICATE_CLOSE_SOURCE))
>     {
>       msg = "popen2: pipe creation failed";
>       return -1;
>     }
>   if (! CreatePipe (&parentRead, &childWrite, 0, 0) ||
>       ! DuplicateHandle (hProcess, childWrite, hProcess, &childWrite,
> 0, TRUE, DUPLICATE_SAME_ACCESS |
> DUPLICATE_CLOSE_SOURCE))
>     {
>       msg = "popen2: pipe creation failed";
>       return -1;
>     }
>   if (! sync_mode)
>     {
>       pipeMode = PIPE_NOWAIT;
>       SetNamedPipeHandleState (parentRead, &pipeMode, 0, 0);
>     }
>   fildes[1] = _open_osfhandle (reinterpret_cast<long> (parentRead),
> _O_RDONLY | _O_BINARY);
>   fildes[0] = _open_osfhandle (reinterpret_cast<long> (parentWrite),
> _O_WRONLY | _O_BINARY);
>   si.dwFlags |= STARTF_USESTDHANDLES;
>   si.hStdInput = childRead;
>   si.hStdOutput = childWrite;
>
>   // Ignore first arg as it is the command
>   for (int k=1; k<args.length(); k++)
>     command += " \"" + args[k] + "\"";
>   OCTAVE_LOCAL_BUFFER (char, c_command, command.length () + 1);
>   strcpy (c_command, command.c_str ());
>   if (! CreateProcess (0, c_command, 0, 0, TRUE, 0, 0, 0, &si, &pi))
>     {
>       msg = "popen2: process creation failed";
>       return -1;
>     }
>   SetPriorityClass(pi.hProcess, ABOVE_NORMAL_PRIORITY_CLASS); // added
> line
>   pid = pi.dwProcessId;
>
>   CloseHandle (childRead);
>   CloseHandle (childWrite);
>   CloseHandle (pi.hProcess);
>   CloseHandle (pi.hThread);
>
>   return pid;
> }
> *******************
>
>   SetPriorityClass(pi.hProcess, ABOVE_NORMAL_PRIORITY_CLASS); // added
> line
>
> This make the child process has always has the absolute higher priority
> class.
> If the parent process is octave and child process is gnuplot this is
> realistic.
> However in general sense I have an anxiety for this simple patch
>
> Your code is worth to be examined.
>

> Thanks!!
>
> Tatsuro
>
> --- Saarela Olli wrote:
>
> > Hi,
> >
> > > octave-3.2.0 occupied 99% cpu activity and thus I guessed that
> > > the speed gnuplot made slower and thus led to slooooow plotting.
> >
> > Such symptoms can arise if the lack of select() in Windows is worked
> around with something like
> >
> >   time_t now = time(NULL);
> >   while (time(NULL) < now + timeout) {
> >     PeekNamedPipe(read_handle, NULL, 0, NULL, &len, NULL));
> >     if (len > 0) // data is available
> >       break;
> >   }
> >
> > which would consume all available CPU time until the program at the
> other end of the pipe has
> > written something.  If this is the case, instead of treating the
> symptoms with changed process
> > priorities you might want to go closer to the root cause by adding a
> short sleep to the code,
> > e.g.,
> >
> >   DWORD sleeptime = 1; // 1 millisecond
> >   time_t now = time(NULL);
> >   while (time(NULL) < now + timeout) {
> >     PeekNamedPipe(read_handle, NULL, 0, NULL, &len, NULL));
> >     if (len > 0) // data is available
> >       break;
> >     Sleep(sleeptime);
> >     if (sleeptime < 64)
> >        sleeptime *= 2;
> >   }
> >
> > I don't know my way around Octave's C++ sources and couldn't find
> PeekNamedPipe in them, so I
> > don't really know if this is the case. The actual loop structure (if
> any) could involve calling
> > several functions and instead of PeekNamedPipe can, e.g., call an
> unblocking read. Anyway, I
> > hope this helps debugging.
> >
> > Cheers, Olli
> >
> >
>
>
> --------------------------------------
> Power up the Internet with Yahoo! Toolbar.
> http://pr.mail.yahoo.co.jp/toolbar/


_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
Matthias Brennwald-2

Re: Plotting with 3.2.0 on Windows is SLOOOOOOWWWW

Reply Threaded More More options
Print post
Permalink
In reply to this post by Matthias Brennwald
[hidden email] wrote:

Dear all

I promised to confirm my versions of Windows XP. I have Windows XP
Professional on both of my machines (VirtualBox on Apple MacBook and a
Pentium-4). In the meantime I upgraded the memory of the Pentium machine
from 256 MB to 4 GB, but this did not help much with the slowness.

 From the posts by Tatsuro, John and Olli I take that there is an issue
related to the process priorities in Octave/gnuplot on Windows. So I
guess it was not me doing something wrong...

Thanks for the great support!

Matthias
_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
Tatsuro MATSUOKA-2

Re: Plotting with 3.2.0 on Windows is SLOOOOOOWWWW

Reply Threaded More More options
Print post
Permalink
Hello

--- Matthias Brennwald  wrote:

> [hidden email] wrote:
>
> Dear all
>
> I promised to confirm my versions of Windows XP. I have Windows XP
> Professional on both of my machines (VirtualBox on Apple MacBook and a
> Pentium-4). In the meantime I upgraded the memory of the Pentium machine
> from 256 MB to 4 GB, but this did not help much with the slowness.

This issue comes from task scheduling between the parent (octave ) and child (gnuplot) processes. T
The cpu of my computer in university is pentium with hyper threaded. It has a two logical core so that
task scheduling problem is not sever.  

>  From the posts by Tatsuro, John and Olli I take that there is an issue
> related to the process priorities in Octave/gnuplot on Windows. So I
> guess it was not me doing something wrong...

Thank you for your reporting the issue.  Your post have revealed an important points for octave for
windows.  

> Thanks for the great support!

I have not enough time to try the proposal of the Olli but until this week end I will try and report
here.  The modification will be implemented in the next release of octave for windows.

Regards

Tatsuro

--------------------------------------
Power up the Internet with Yahoo! Toolbar.
http://pr.mail.yahoo.co.jp/toolbar/
_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
1 2