This is the mail archive of the
cygwin-apps
mailing list for the Cygwin project.
Re: gnuplot patch to speed up cygwin implementation by 2x
- From: Jim Kleckner <jek-cygwin2 at kleckner dot net>
- To: cygwin-apps at cygwin dot com
- Date: Fri, 27 Jun 2008 17:57:12 -0700
- Subject: Re: gnuplot patch to speed up cygwin implementation by 2x
- References: <48611BF4.6040608@kleckner.net> <48614382.4000800@kleckner.net>
- Reply-to: cygwin-apps at cygwin dot com
Jim Kleckner wrote:
Jim Kleckner wrote:
The attached patch for gnuplot speeds it up on Cygwin
by around 2.5x due to unbuffered reads for all file types.
I will submit it upstream as well.
See this link for the original discussion:
http://tinyurl.com/6c4sse
http://thread.gmane.org/gmane.comp.graphics.gnuplot.devel/2189/focus=2207
I got it to work. I made a simple mistake in building.
Please consider the attached patch for gnuplot.
Jim
diff -urN -x CYGWIN-PATCHES -x 'aclocal.m4*' -x autom4te.cache -x config.cache -x config.log -x config.status -x config.h -x config.h.in -x ABOUT-NLS -x Makefile.in.in -x Makevars.template -x '*SlackBuild*' -x '*.egg-info' -x '*.class' -x '*.pyc' -x '*.mo' -x '*.gmo' -x '*.orig' -x '*.rej' -x '*.spec' -x '*.temp' -x '*~' -x '*.stackdump' -x COPYING -x INSTALL -x compile -x config-ml.in -x config.guess -x config.sub -x depcomp -x elisp-comp -x install-sh -x ltmain.sh -x mdate-sh -x missing -x mkinstalldirs -x py-compile -x symlink-tree -x texinfo.tex -x ylwrap -x config.rpath -x Makefile.in -x makefile.in -x configure -x omf.make -x xmldocs.make -x gnome-doc-utils.make -x gnome-doc-utils.m4 -x intltool.m4 -x intltool-extract -x intltool-extract.in -x intltool-merge -x intltool-merge.in -x intltool-update -x intltool-update.in -x gnuplot.texi origsrc/gnuplot-4.2.3/src/plot.c src/gnuplot-4.2.3/src/plot.c
--- origsrc/gnuplot-4.2.3/src/plot.c 2007-06-07 09:26:32.000000000 -0700
+++ src/gnuplot-4.2.3/src/plot.c 2008-06-27 17:45:33.974729600 -0700
@@ -433,8 +433,15 @@
* Failing this, I propose we just make the call and
* ignore the return : its probably not a big deal
*/
+#ifdef __CYGWIN__
+ if (isatty(fileno(stdin))) {
+ if (setvbuf(stdout, (char *) NULL, _IOLBF, (size_t) 1024) != 0)
+ (void) fputs("Could not linebuffer stdout\n", stderr);
+ }
+#else
if (setvbuf(stdout, (char *) NULL, _IOLBF, (size_t) 1024) != 0)
(void) fputs("Could not linebuffer stdout\n", stderr);
+#endif
#ifdef X11
/* This call used to be in x11.trm, with the following comment:
@@ -448,8 +455,14 @@
* Do any non-X platforms suffer from the same problem?
* EAM - Jan 2004.
*/
+#ifdef __CYGWIN__
+ if (isatty(fileno(stdin))) {
+ setvbuf(stdin, (char *) NULL, _IONBF, 0);
+ }
+#else
setvbuf(stdin, (char *) NULL, _IONBF, 0);
#endif
+#endif
#endif
diff -urN -x CYGWIN-PATCHES -x 'aclocal.m4*' -x autom4te.cache -x config.cache -x config.log -x config.status -x config.h -x config.h.in -x ABOUT-NLS -x Makefile.in.in -x Makevars.template -x '*SlackBuild*' -x '*.egg-info' -x '*.class' -x '*.pyc' -x '*.mo' -x '*.gmo' -x '*.orig' -x '*.rej' -x '*.spec' -x '*.temp' -x '*~' -x '*.stackdump' -x COPYING -x INSTALL -x compile -x config-ml.in -x config.guess -x config.sub -x depcomp -x elisp-comp -x install-sh -x ltmain.sh -x mdate-sh -x missing -x mkinstalldirs -x py-compile -x symlink-tree -x texinfo.tex -x ylwrap -x config.rpath -x Makefile.in -x makefile.in -x configure -x omf.make -x xmldocs.make -x gnome-doc-utils.make -x gnome-doc-utils.m4 -x intltool.m4 -x intltool-extract -x intltool-extract.in -x intltool-merge -x intltool-merge.in -x intltool-update -x intltool-update.in -x gnuplot.texi origsrc/gnuplot-4.2.3/src/readline.c src/gnuplot-4.2.3/src/readline.c
--- origsrc/gnuplot-4.2.3/src/readline.c 2006-04-28 09:54:03.000000000 -0700
+++ src/gnuplot-4.2.3/src/readline.c 2008-06-27 17:45:35.476889600 -0700
@@ -1014,7 +1014,13 @@
# endif /* TERMIOS */
# endif /* not SGTTY */
# else /* OSK */
+#ifdef __CYGWIN__
+ if (isatty(fileno(stdin))) {
+ setbuf(stdin, (char *) 0); /* Make stdin and stdout unbuffered */
+ }
+#else
setbuf(stdin, (char *) 0); /* Make stdin and stdout unbuffered */
+#endif
setbuf(stderr, (char *) 0);
_gs_opt(STDIN, &new_settings);
# endif /* OSK */
diff -urN -x CYGWIN-PATCHES -x 'aclocal.m4*' -x autom4te.cache -x config.cache -x config.log -x config.status -x config.h -x config.h.in -x ABOUT-NLS -x Makefile.in.in -x Makevars.template -x '*SlackBuild*' -x '*.egg-info' -x '*.class' -x '*.pyc' -x '*.mo' -x '*.gmo' -x '*.orig' -x '*.rej' -x '*.spec' -x '*.temp' -x '*~' -x '*.stackdump' -x COPYING -x INSTALL -x compile -x config-ml.in -x config.guess -x config.sub -x depcomp -x elisp-comp -x install-sh -x ltmain.sh -x mdate-sh -x missing -x mkinstalldirs -x py-compile -x symlink-tree -x texinfo.tex -x ylwrap -x config.rpath -x Makefile.in -x makefile.in -x configure -x omf.make -x xmldocs.make -x gnome-doc-utils.make -x gnome-doc-utils.m4 -x intltool.m4 -x intltool-extract -x intltool-extract.in -x intltool-merge -x intltool-merge.in -x intltool-update -x intltool-update.in -x gnuplot.texi origsrc/gnuplot-4.2.3/src/variable.c src/gnuplot-4.2.3/src/variable.c
--- origsrc/gnuplot-4.2.3/src/variable.c 2006-06-26 19:36:30.000000000 -0700
+++ src/gnuplot-4.2.3/src/variable.c 2008-06-24 11:11:28.004584000 -0700
@@ -262,6 +262,11 @@
{ "$`kpsexpand '$TEXMFMAIN'`/fonts/type1!" },
{ "$`kpsexpand '$TEXMFDIST'`/fonts/type1!" },
#endif
+#ifdef __CYGWIN__
+ /* teTeX in the cygwin distribution */
+ { "/usr/local/share/texmf/fonts/type1!" },
+ { "/usr/share/texmf/fonts/type1!" },
+#endif
/* Linux paths */
{ "/usr/X11R6/lib/X11/fonts/Type1" },
{ "/usr/X11R6/lib/X11/fonts/truetype" },
@@ -270,6 +275,11 @@
/* Ghostscript */
{ "/usr/share/ghostscript/fonts" },
{ "/usr/local/share/ghostscript/fonts" },
+#ifdef __CYGWIN__
+ /* Misc. fonts */
+ { "/usr/local/share/fonts!" },
+ { "/usr/share/fonts!" },
+#endif
{ NULL }
};
#endif