🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.powerpc
Article #3539

Re: Debate: PowerMac "trounces" Pentium....???

#3539
From: Stephen Knilans
Date: Sat, 30 Mar 1996 14:44
315 lines
10197 bytes
In article <mem-2903961057080001@durin.pha.jhu.edu> mem@jhu.edu (Mel Martinez) writes:
>In article <stephenkDp0JpA.F6u@netcom.com>, stephenk@netcom.com (Stephen
>Knilans) wrote:
>] 
>] Ya know, I WAS going to mail this post back seperate, but I guess I'll do it 
>] HERE!  the P5 was "EATEN ALIVE" by the 601, HUH?  Look at this, and tell
>me how
>] we are mistaken!
>] 
>] #include <stdio.h>
>] #include <math.h>
>]  
>] void main(void)
>] {
>]         double  sum, i;
>]         
>]         sum = 0;
>]         for(i=1;i<10000000;i++)
>]         {
>]                 sum = sum + sqrt(sin(i/4.2)*sin(i/4.2) + log(i));
>]         }
>]         printf("total: %f", sum);
>] }
>] /*** end ***/
>] /*  
>
>This benchmark is pretty useless as a general indicator or even as a
>floating point benchmark.  It is far too heavily laden with
>trancendentals, which are going to be library implemented on most risc
>chips and even some cisc chips.  I.E. drop in a different mathlib on the
>same machine and this mark will probably get vastly different marks.
>
>Also, this mark is static in scale and branch.  Try varying both the loop
>size and also add a memory reference or two (to a varying memory structure
>size) and see how the relative marks between machines will vary
>tremendously.
>
>Creating useful benchmarks is not a trivial task.
>
>In other words, don't put too much stock in any results from timing this mark.
>
>Bit bucket.
>
>Cheers,
>
>Mel Martinez
>The Johns Hopkins University
>Dept. of Physics
>mem@jhu.edu

Actually, I had nothing to do with this benchmark, but figured it was a good 
test of FPU performance.  If you want to see the benchmark *I* wrote, here
it is:

#include <stdio.h>
typedef void (*sighandler_t) ();
sighandler_t alrm_time, func, func2;
#include <signal.h>
unsigned long signalyn;
double loops;
char *pnt;
long total;
double totald, tpt, vtpt, vtpt2;
long round;
char ch;
long RESOLUTION =5;
long hirecord, lorecord;
FILE *in;
char buffer[2000];

void alrmstop()
{
    alarm(0);
    signalyn = 1;
    return;
}

void do_loop()
{
    alrm_time = alrmstop;
    signal(SIGALRM, alrm_time);
    alarm(RESOLUTION);
    loops = 0;
    signalyn = 0;
    while (signalyn == 0)
      {
	  loops++;
	  func();
      }
    loops = (double) loops / (double) RESOLUTION;
    tpt = (double) 1.0 / (double) loops;
    tpt -= vtpt;
    loops = (double) ((double) 1.0 / (double) tpt);
}

void void_test()
{
    return;
}

void long_add_test()
{
    total += 3;
    total *= 2;
    total -= 3;
    total /= 2;
    return;
}

void long_double_test()
{
    totald += 3;
    totald *= 2;
    totald -= 3;
    totald /= 2;
    return;
}

void chario_test()
{
    printf(" \b");
    return;
}
void diskiotest()
{
    alarm(0);
    in = fopen("diskio.tst", "r+");
    alarm(RESOLUTION);
    while (signalyn == 0)
      {
	  hirecord = 10 * 1024;
	  lorecord = 0;
          fseek(in, 0, SEEK_SET);
	  while (lorecord != hirecord && signalyn == 0)
	    {
		hirecord--;
		lorecord++;
		func2();
		loops++;
	    }
      }
    alarm(0);
    fclose(in);
}

void null_diskio()
{
    fseek(in, 0, SEEK_SET);
    fread(&buffer[0], 1024, 1, in);
    fseek(in, 0, SEEK_SET);
    fread(&buffer[0], 1024, 1, in);
}

void write_diskio()
{
    fseek(in, lorecord * 1024, SEEK_SET);
    fwrite(&buffer[0], 1024, 1, in);
    fseek(in, hirecord * 1024, SEEK_SET);
    fwrite(&buffer[0], 1024, 1, in);
}

void read_diskio()
{
    fseek(in, lorecord * 1024, SEEK_SET);
    fread(&buffer[0], 1024, 1, in);
    fseek(in, hirecord * 1024, SEEK_SET);
    fread(&buffer[0], 1024, 1, in);
}
void read_diskio2()
{
    fseek(in, lorecord * 1024, SEEK_SET);
    fread(&buffer[0], 1024, 1, in);
    lorecord+=1024;
    hirecord=lorecord;
    if (hirecord>10000000)lorecord=1;
    fseek(in, hirecord * 1024, SEEK_SET);
    fread(&buffer[0], 1024, 1, in);
}
void write_diskio2()
{
    fseek(in, lorecord * 1024, SEEK_SET);
    fwrite(&buffer[0], 1024, 1, in);
    lorecord+=1024;
    hirecord=lorecord;
    if (hirecord>10000000)lorecord=1;
    fseek(in, hirecord * 1024, SEEK_SET);
    fwrite(&buffer[0], 1024, 1, in);
}


void main()
{
    FILE *out;
    out = fopen("results.out", "w+");
    printf("Standardized system throughput test\n");
    printf("Written by Stephen Knilans\n");
    printf("1995 all rights reserved\n");
    printf("\n\nPLEASE WAIT!\n\n");
    printf("To maintain accuracy, each of the following 6 tests takes\n");
    printf("%lu seconds.\n\n",RESOLUTION);
    fprintf(out, "Standardized system throughput test\n");
    fprintf(out, "Written by Stephen Knilans\n");
    fprintf(out, "1996 all rights reserved\n");
    unlink("diskio.tst");
    in = fopen("diskio.tst", "w+");
    write(in, &buffer, 1024);
    fseek(in, 35000, SEEK_SET);
    write(in, &buffer, 1024);
    fclose(in);
    func = void_test;
    vtpt = 0.0;
    do_loop();
    printf("This system can do %8.0lf loops per second.\n", loops);
    fprintf(out, "This system can do %8.0lf loops per second.\n", loops);
    vtpt = tpt;
    func = long_add_test;
    do_loop();
    printf("This system can do %8.0lf long groups per second.\n", loops);
    fprintf(out, "This system can do %8.0lf long groups per second.\n", loops);
    if (loops == 0 && total == 0)
	printf("\n an error has occured");
    func = long_double_test;
    do_loop();
    printf("This system can do %8.0lf double groups per second.\n", loops);
    fprintf(out, "This system can do %8.0lf double groups per second.\n", loops);
    if (loops == 0 && totald == 0)
	printf("\n an error has occured");
    func = chario_test;
    do_loop();
    printf("This system can do %8.0lfcps raw term character I/O.\n", loops * 2);
    fprintf(out, "This system can do %8.0lfcps raw term character I/O.\n", loops * 2);
    func = diskiotest;
    func2 = null_diskio;
    do_loop();
    vtpt2 = tpt;
    printf("This system can do %11.3lfMB/s from disk cache.\n", loops /1024);
    fprintf(out, "This system can do %11.3lfMB/s from disk cache.\n", loops / 1024);
    func2 = write_diskio;
    do_loop();
    tpt = (double) 1.0 / (double) loops;
    tpt -= vtpt2;
    loops = (double) ((double) 1.0 / (double) tpt);
    printf("This system can do %11.3lfMB/s random writes, to disk.\n", loops /1024);
    fprintf(out, "This system can do %11.3lfMB/s random writes, to disk.\n", loops / 1024);
    func2 = read_diskio;
    do_loop();
    tpt = (double) 1.0 / (double) loops;
    tpt -= vtpt2;
    loops = (double) ((double) 1.0 / (double) tpt);
    printf("This system can do %11.3lfMB/s random reads, from disk.\n", loops /1024);
    fprintf(out, "This system can do %11.3lfMB/s random reads, from disk.\n", loops / 1024);
    if (loops == 0 && ch == 0)
	printf("\n an error has occured");
    func2 = write_diskio2;
    do_loop();
    tpt = (double) 1.0 / (double) loops;
    tpt -= vtpt2;
    loops = (double) ((double) 1.0 / (double) tpt);
    printf("This system can do %11.3lfMB/s writes, to disk.\n", loops /1024);
    fprintf(out, "This system can do %11.3lfMB/s writes, to disk.\n", loops / 1024);
    if (loops == 0 && ch == 0)
	printf("\n an error has occured");
    func2 = read_diskio2;
    do_loop();
    tpt = (double) 1.0 / (double) loops;
    tpt -= vtpt2;
    loops = (double) ((double) 1.0 / (double) tpt);
    printf("This system can do %11.3lfMB/s reads, from disk.\n", loops /1024);
    fprintf(out, "This system can do %11.3lfMB/s reads, from disk.\n", loops / 1024);
    if (loops == 0 && ch == 0)
	printf("\n an error has occured");
    fclose(out);
}


It has some appearantly dead code, but don't remove it.  HERE are the results 
for MY machine:

On a P5/100 with 256K PB cache, an NCR 825 based tyan SCSI controller, over
a 10Mbps network.
 
Standardized system throughput test
Written by Stephen Knilans
1996 all rights reserved
This system can do  3447197 loops per second.
This system can do  4750498 long groups per second.
This system can do  1451460 double groups per second.
This system can do     6560cps raw term character I/O.
This system can do      48.307MB/s from disk cache.
This system can do       0.545MB/s random writes, to disk.
This system can do       1.131MB/s random reads, from disk.
This system can do       2.010MB/s writes, to disk.
This system can do       6.644MB/s reads, from disk.

This test has NO transcendentals, and isolates each test.  The disk cache test
tests the ABSOLUTE maximum random disk performance possible, and the random
reads/writes test the worst.  The last two read/writes test what should be 
considered the maximum throughput for the disk/controller in question.

Obviously, since this routine has a resolution of one second, numbers may vary
slightly.  The raw term I/O is about the only one that likely won't vary.  
These variances are generally slight though, on a percentage basis.

BTW, this program DOES expect at least 10MB of free disk space, for those tests.
The file name is diskio.tst.  

Stephen Knilans


I don't consider this perfect, nor do I consider ANY benchmark perfect.  It
doesn't test cache misses, outside of disk caches, and doesn't test various
CPU performance mod misses, etc....  I think it IS a good test of certain 
standard CPU ops, disk access code, terminal I/O(although it doesn't test 
scrolling or commands), controller and drive throughput.  
 
Technical Details
Message-ID: <stephenkDp34yH.Dtw@netcom.com>
Path: arc1-ca.pugleaf.net!netcom.com!stephenk
References: <dke-2803961851210001@adnline290.adnc.com> <stephenkDp0JpA.F6u@netcom.com> <mem-2903961057080001@durin.pha.jhu.edu>

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.powerpc,comp.os.linux.advocacy,comp.sys.mac.advocacy,comp.os.os2.advocacy,comp.sys.amiga.advocacy,comp.sys.intel
Path: arc1-ca.pugleaf.net!netcom.com!stephenk
From: stephenk@netcom.com (Stephen Knilans)
Subject: Re: Debate: PowerMac "trounces" Pentium....???
Message-ID: <stephenkDp34yH.Dtw@netcom.com>
Organization: Netcom Online Communications Services (408-241-9760 login: guest)
References: <dke-2803961851210001@adnline290.adnc.com> <stephenkDp0JpA.F6u@netcom.com> <mem-2903961057080001@durin.pha.jhu.edu>
Date: Sat, 30 Mar 1996 14:44:41 GMT
Sender: stephenk@netcom16.netcom.com