Subject: bad performance?
To: None <current-users@sun-lamp.cs.berkeley.edu>
From: Michael Graff <explorer@vorpal.com>
List: current-users
Date: 12/07/1993 13:56:48
This is a dorky little speed test a friend wrote up.  It runs in something
like 55 seconds on a i486dx/33 running linux, and over 370 seconds on my
i486dx/40!

And clue what might be up?  Is math processing that shitty on netbsd these
days?

#include <stdio.h>
#include <math.h>
#include <time.h>

#define COUNT 250000

int main(int argc, char **argv)
{
	double  x, *y;
	int     i, j;
	time_t  t;

	y = malloc(sizeof(double) * COUNT);
	
	if (y == NULL) {
		fprintf(stderr, "cannot allocate memory\n");
		exit(1);
	}

	time(&t);
	for (j = 0 ; j < 4 ; j++)
		for (i = 0 ; i < COUNT ; i++) {
			x = 11.0+(33.5*i)*(33.5*i);
			y[i] = (sin(3.1*i)+cos(5.1*i))*sqrt(x+exp(3.14*log(x+i)));
		}
	printf("time=%d\n",time(0)-t);
}


--Michael

--
Michael Graff                 <explorer@vorpal.com>
1304 Florida #3               (515) 296-2735
Ames, IA  50014		PGP key on a key-server near you!

------------------------------------------------------------------------------