Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site umcp-cs.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!umcp-cs!chris From: chris@umcp-cs.UUCP (Chris Torek) Newsgroups: net.sources Subject: Re: Latest Drystone Benchmarks Message-ID: <1888@umcp-cs.UUCP> Date: Thu, 17-Oct-85 02:41:08 EDT Article-I.D.: umcp-cs.1888 Posted: Thu Oct 17 02:41:08 1985 Date-Received: Sat, 19-Oct-85 03:57:52 EDT References: <144@vaximile.UUCP> Organization: U of Maryland, Computer Science Dept., College Park, MD Lines: 148 Here are some changes to get more accurate results under 4.2 and 4.3 BSD; and here is the result of running the benchmarks on our shiny new 8600 (not yet even fully installed, but already running 4.3BSD... for the moment, at least): * MACHINE MICROPROCESSOR OPERATING COMPILER DHRYSTONES/SEC. * TYPE SYSTEM NO REG REGS * -------------------------- ------------ ----------- --------------- * VAX 8600 - 4.3BSD cc 7092 7153 The speed of the 8600 is quite impressive. Oh yes, the changes. Without these I get 7142 for both `NO REG' and `REG', by the way. *** dry.c.old Thu Oct 17 01:55:55 1985 --- dry.c Thu Oct 17 02:23:02 1985 *************** *** 156,166 **** #define LOOPS 50000 long time(); ! long starttime; ! long benchtime; ! long nulltime; register unsigned int i; ! starttime = time(0); for (i = 0; i < LOOPS; ++i); ! nulltime = time(0) - starttime; PtrGlbNext = (RecordPtr) malloc(sizeof(RecordType)); --- 156,167 ---- #define LOOPS 50000 long time(); ! long starttime, startmil; ! long benchtime, benchmil; ! long nulltime, nullmil; register unsigned int i; ! gettime(&starttime, &startmil); for (i = 0; i < LOOPS; ++i); ! gettime(&nulltime, &nullmil); ! timesub(&nulltime, &nullmil, starttime, startmil); PtrGlbNext = (RecordPtr) malloc(sizeof(RecordType)); *************** *** 175,179 **** -- Start Timer -- *****************/ ! starttime = time(0); for (i = 0; i < LOOPS; ++i) { --- 176,180 ---- -- Start Timer -- *****************/ ! gettime(&starttime, &startmil); for (i = 0; i < LOOPS; ++i) { *************** *** 206,213 **** *****************/ } ! benchtime = time(0) - starttime - nulltime; ! printf("Dhrystone time for %ld passes = %ld\n", (long) LOOPS, benchtime); ! printf("This machine benchmarks at %ld dhrystones/second\n", ! ((long) LOOPS) / benchtime); } --- 207,217 ---- *****************/ } ! gettime(&benchtime, &benchmil); ! timesub(&benchtime, &benchmil, starttime, startmil); ! timesub(&benchtime, &benchmil, nulltime, nullmil); ! printf("Dhrystone time for %ld passes = %ld.%03d\n", (long) LOOPS, ! benchtime, benchmil); ! printf("This machine benchmarks at %8.0f dhrystones/second\n", ! (double)LOOPS / ((double)benchtime + (benchmil / 1000.0))); } *************** *** 415,417 **** --- 419,481 ---- return t; } + #endif + + #include /* horrible hack to detect 4.[23]BSD */ + #ifdef SIGVTALRM + #define GETTIMEOFDAY + #endif + + /* + * Gettime gets the time in seconds and milliseconds. timesub subtracts + * the second time (in sec, mil) from the first (sec, mil). + */ + #ifndef GETTIMEOFDAY + + gettime(s, m) + long *s, *m; + { + + (void) time(s); + *m = 0; + } + + timesub(ds, dm, s, m) + long *ds, *dm, s, m; + { + + *ds -= s; + } + + #else + + #include + + gettime(s, m) + long *s, *m; + { + struct timeval now; + + if (gettimeofday(&now, (struct timezone *)0)) + perror("gettimeofday"), exit(1); + *s = now.tv_sec; + *m = now.tv_usec / 1000; + } + + /* + * N.B.: we assume 0 <= m < 1000. + */ + timesub(ds, dm, s, m) + long *ds, *dm, s, m; + { + register long s1 = *ds, m1 = *dm; + + s1 -= s; + if ((m1 -= m) < 0) { + s1--; + m1 += 1000; + } + *ds = s1; + *dm = m1; + } + #endif -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 4251) UUCP: seismo!umcp-cs!chris CSNet: chris@umcp-cs ARPA: chris@mimsy.umd.edu