[589] in Athena Bugs
do we have enough eqn users to make this worthwhile?
daemon@ATHENA.MIT.EDU (Henry Mensch)
Mon Aug 8 17:42:32 1988
Date: Mon, 8 Aug 88 17:06:36 EDT
From: henry@GARP.MIT.EDU (Henry Mensch)
Errors-To: <henry@GARP.MIT.EDU>
To: bugs@ATHENA.MIT.EDU
From: bs@sbsvax.UUCP (Bernard Sieloff)
Newsgroups: comp.bugs.4bsd
Subject: [n]eqn(1) speedup
Keywords: [n]eqn munches too much CPU time
Message-ID: <583@sbsvax.UUCP>
Date: 7 Aug 88 19:29:19 GMT
Organization: Universitaet des Saarlandes, Saarbruecken, West Germany
Lines: 57
Subject: [n]eqn(1) speedup
Description:
This is no *real* bug, but it chews unnecessarily a lot of CPU time, if
you have some BIG [n]eqn input files.
Input to eqn with no effect to eqn itself will be passed unaltered to
stdout, but by calling printf()!
Eqn behavior is heavily sped up, if the "passing"-printf() calls are
changed to fputs() calls.
Fix:
Apply the following diff with Larry Wall's "patch" program.
The concerned file is io.c in eqn's source directory.
*** io.c.orig Sun Sep 4 00:19:07 1983
--- io.c Sun Aug 7 20:39:03 1988
***************
*** 32,38 ****
eqline = linect;
if (in[0]=='.' && in[1]=='E' && in[2]=='Q') {
for (i=11; i<100; used[i++]=0);
! printf("%s",in);
printf(".nr 99 \\n(.s\n.nr 98 \\n(.f\n");
markline = 0;
init();
--- 32,38 ----
eqline = linect;
if (in[0]=='.' && in[1]=='E' && in[2]=='Q') {
for (i=11; i<100; used[i++]=0);
! fputs(in, stdout); /* [bs] */
printf(".nr 99 \\n(.s\n.nr 98 \\n(.f\n");
markline = 0;
init();
***************
*** 58,64 ****
else if (type == lefteq)
inline();
else
! printf("%s",in);
}
return(0);
}
--- 58,64 ----
else if (type == lefteq)
inline();
else
! fputs(in, stdout); /* [bs] */
}
return(0);
}
--
Bernard Sieloff | UUCP: ...!uunet!unido!sbsvax!bs
Universitaet des Saarlandes | or bs@sbsvax.UUCP
FB 10 - Informatik (Dept. of CS) | CSNET: bs%sbsvax.uucp@Germany.CSnet
Bau 36, Im Stadtwald 15 | ARPA: bs%sbsvax.uucp@uunet.UU.NET
D-6600 Saarbruecken 11, W. Germany | Phone: +49 681 302 2434