|
From: Jim K. <je...@kl...> - 2005-01-11 05:47:42
|
Jim Kleckner wrote:
> I'm using gnuplot to create PDF files most of the time. I find that
> the unbuffered setting to make X11 work with the mouse and pasteboard
> vastly increases the syscall overhead for this batch operation. Would
> it make sense to add an argument to be able to permit buffering? I'm
> using cygwin so perhaps there is some set of porting options that
> interact on this platform.
I looked at the code lower down where the "interactive" variable is set.
The most minimal change seemed to be to duplicate the isatty code as
follows:
diff -u -r1.72 plot.c
--- plot.c 25 Aug 2004 22:33:16 -0000 1.72
+++ plot.c 11 Jan 2005 05:26:21 -0000
@@ -422,7 +422,9 @@
* Do any non-X platforms suffer from the same problem?
* EAM - Jan 2004.
*/
- setvbuf(stdin, (char *) NULL, _IONBF, 0);
+ if (isatty(fileno(stdin))) {
+ setvbuf(stdin, (char *) NULL, _IONBF, 0);
+ }
#endif
My regression tests before the change (on a 3GHz P4 HT machine) used:
940.66user 628.54system 25:19.91elapsed
and after:
621.38user 5.32system 10:22.86elapsed
The difference is so big because I'm using gnuplot-py to drive
the plots and it uses a pipe and inline data (quite a lot of it).
Comments? I might easily be missing something important
here.
Jim
|