gritz@seas.gwu.edu (Larry Gritz) (06/12/91)
About a week ago, I posted a sample program to illustrate how some programs
actually run slower after the 68040 upgrade is installed in a HP-9000/400t
upgraded to a 425t. I have received many helpful replies. To summarize
my important findings:
1. Other people reproduce the same problem under HP-UX.
2. People running NeXT 040 machines and HP DOMAIN machines don't have the
problem. (NeXT did at first, but was corrected.)
3. The worst problem is specifically related to conversion of doubles to
ASCII strings, such is performed by the *printf family of functions.
4. The whole problem can be solved by a replacement for the C runtime
library which includes a float->ascii conversion routine using a
different algorithm.
5. The latest word from HP is that they think this is fixed in HP-UX 8.0.
However, this is not certain, nor is it clear when we will receive
the update to UP-UX 8.0.
I am reposting the following sample program which illustrates the problem.
This is even simpler than my first example, and doesn't create large
output files (sorry about that). Please note that the total run time is
17.56 seconds on the 030-based 400t, but is 11 MINUTES and 35.58 seconds
on the 040-based 425t.
--------------------- 8< Example program: cut here >8 --------------------
#include <stdio.h>
#include <math.h>
/*
This sample program demonstrates problems with the 68040
cpu. Here are benchmarks for the same program, run on
(1) A 68030 diskless HP9000/400t, 8 Mb RAM, served by an
HP9000/835 disk server,
(2) A 68040 HP9000/425t, with 16 Mb RAM, internal 200 Mb and
external 330 Mb disks.
TIME: (1) 68030 (2) 68040
real 0m 17.56 s 11m 35.58 s
user 0m 17.18 s 0m 9.26 s
system 0m 0.02 s 11m 41.74 s
*/
#define NVALS 100000
void main (int argc, char *argv[])
{
char buffer[256];
double test = 1.239480;
int i;
printf("Ready to output stuff\n");
/* The program reaches this stage instantly; all the time-wasting
takes place below: */
for (i = 0; i < NVALS; i++)
sprintf (buffer, "%19.12lf\n", test);
printf ("Done.\n");
}
--
Larry Gritz lg@galileo.usno.navy.mil
US Naval Observatory phone: 202-653-1034
Washington, DC 20392-5100 also: gritz@seas.gwu.edu