Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site msdc.UUCP Path: utzoo!linus!decvax!harpo!whuxlm!akgua!gatech!msdc!paul From: paul@msdc.UUCP (Paul Manno) Newsgroups: net.sources Subject: The 30 Minute Benchmark Message-ID: <109@msdc.UUCP> Date: Thu, 25-Oct-84 21:05:36 EST Article-I.D.: msdc.109 Posted: Thu Oct 25 21:05:36 1984 Date-Received: Tue, 30-Oct-84 07:12:17 EST Organization: Medical Systems Development Corp., Atlanta Lines: 917 A copy of the benchmark programs producing the following results has been published in net.sources for your enjoyment. In order to make any sense of these numbers, you MUST review the benchmark programs and system configurations in net.sources. We accept no responsibility for your use of the data. Here is a summary of some of the results with the numbers given as real/user/sys time in seconds. ("Sort" is the execution of sort on a 1MB file of random ASCII integers; "memdisk" and "memcpu" are the average times for execution of five concurrent copies of the "disk" and "cpu" benchmarks.) machine | sort | memdisk | memcpu -----------------|------------|-----------|------------ VAX 750 - 4.1BSD | 455/316/68 | 668/27/32 | 1132/207/9 VAX 750 - 4.2BSD | 309/281/20 | 271/25/17 | 1052/204/4 VAX 780 - 4.1BSD | 357/180/38 | 802/16/21 | 776/106/3 VAX 785 - Ultrix | 119/105/ 8 | 246/10/ 8 | 340/ 68/0.4 For those folks not receiving net.sources, you may request a copy of the programs through UUCP mail or by sending me a tape (pre-addressed and return postage paid, please) to the address below. I welcome constructive comments and additional results you may wish to send. Paul Manno (...{akgua, gatech, mcnc}!msdc!paul) Medical Systems Development Corporation P. O. Box 26022 Atlanta, GA 30335 P.S. The name "The 30 Minute Benchmark" is not derived from the amount of time to run the benchmark. That's the time it took to write it! :-) ======= cut here ======= echo "This is a shell-archive format file." echo "It will extract 10 files in the current directory..." echo "-x README" cat >README <anal.results IT REQUIRES: time: about 0.3 to 1.5 hours depending upon cpu and disk speed. disk: about 6MB in the current directory. mem: about 300KB per process (10 processes max) SUGGESTIONS: I welcome constructive comments on this suite. UUCP mail is preferred but USPS mail is acceptable. Send comments to: Paul Manno (...{akgua, gatech, mcnc}!msdc!paul) Medical Systems Development Corporation P.O. Box 26022 Atlanta, GA 30335 !FUNKYSTUFF! echo "-x Makefile" cat >Makefile <>c.mkfile 2>>c.mkfile memcpu: memcpu.c time cc \$(CFLAGS) memcpu.c -o memcpu >>c.memcpu 2>>c.memcpu memdisk: memdisk.c time cc \$(CFLAGS) memdisk.c -o memdisk >>c.memdisk 2>>c.memdisk !FUNKYSTUFF! echo "-x memcpu.c" cat >memcpu.c < -i -m * * Description: * memcpu allocates a memory buffer (default 100KB) and * initializes each block (default 1024B) to * the char representation of the block number. It then * randomly "seeks" to a block, copies the info to a * local string and compares the converted integer back * to the block number times (default 100000). * * Written: * June, 1984 * Medical Systems Development Corporation * */ #include main(argc, argv) int argc; char *argv[]; { long i; long bsize = 1024; /* default to 1K block size */ long msize = 100000; /* default to 100K mem size */ long iters = 100000; /* default to 100K interations */ long nblocks; char *buf; char str[256]; char *malloc(); char *index(); int rand(); int atoi(); long value; for (i = 1; i < argc; i++) { if (argv[i][0] == '-') switch(argv[i][1]) { case 'm': if ((msize = atoi(&argv[i][2])) <= 0) { fprintf(stderr, "Bad mem size spec.\n"); exit(1); } break; case 'b': if ((bsize = atoi(&argv[i][2])) <= 0) { fprintf(stderr, "Bad block size spec.\n"); exit(1); } break; case 'i': if ((iters = atoi(&argv[i][2])) <= 0) { fprintf(stderr, "Bad iteration count.\n"); exit(1); } break; default: exit(1); } } if (msize <= 0) { fprintf(stderr, "Usage: %s -b -i -m\n", argv[0]); exit(1); } if (bsize <= 0) { fprintf(stderr, "Usage: %s -b -i -m\n", argv[0]); exit(1); } if (bsize > msize) { fprintf(stderr, "%s: block size specified is greater than memory spec.\n", argv[0]); exit(1); } srand(time(0L)); if ((buf = malloc(msize)) == NULL) { fprintf(stderr, "Could not allocate %ld bytes of memory.\n", msize); exit(1); } nblocks = msize / bsize; sprintf(str, "%%0%dd", bsize > 32 ? 32 : bsize - 1); for (i = 0; i < nblocks; i++) sprintf(&buf[i * bsize], str, i); for (; iters > 0; iters--) { i = (rand() * rand() * rand() * rand()) % nblocks; i = i >= 0 ? i : i * (-1); /* ensure it's positive */ strncpy(str, &buf[i * bsize], bsize); /* move a string around */ if (index(str, '0') == NULL) strcpy(str, "0"); value = strlen(&buf[i * bsize]); /* look through memory */ value = atoi(&buf[i * bsize]); /* convert saved number */ if (value != i) fprintf(stderr, "%s: block number mismatch.\n", argv[0]); } } !FUNKYSTUFF! echo "-x memdisk.c" cat >memdisk.c < -f -i -m * * Description: * memdisk writes a file (default name "benchtmp") the size * specified (default 100KB) and fills each block * (default 1024B) with the char representation of the block * number. The file is closed and re-opened for reading. For * the specified number of (default 100000), memdisk * randomly seeks to a block and converts the contents back * into the integer block number for comparison after moving * the string around in memory. * * Written: * June, 1984 * Medical Systems Development Corporation * */ #include main(argc, argv) int argc; char *argv[]; { long i; long bsize = 1024; /* default to 1K block size */ long msize = 100000; /* default to 100K file size */ long iters = 100000; /* default to 100K interations */ long mempad = 300000; /* some amount of bulk memory */ long nblocks; int fd; char *buf; char *str; char *mem; char fname[256]; char *malloc(); char *index(); int rand(); int atoi(); int creat(); long value; strcpy(fname, "benchtmp"); for (i = 1; i < argc; i++) { if (argv[i][0] == '-') switch(argv[i][1]) { case 'm': if ((msize = atoi(&argv[i][2])) <= 0) { fprintf(stderr, "Bad file size spec.\n"); exit(1); } break; case 'b': if ((bsize = atoi(&argv[i][2])) <= 0) { fprintf(stderr, "Bad block size spec.\n"); exit(1); } break; case 'i': if ((iters = atoi(&argv[i][2])) <= 0) { fprintf(stderr, "Bad iteration count.\n"); exit(1); } break; case 'f': strcpy(fname, &argv[i][2]); break; default: fprintf(stderr, "Usage: %s -b -f -i -m\n", argv[0]); exit(1); } } if (msize <= 0) { fprintf(stderr, "Usage: %s -b -f -i -m\n", argv[0]); exit(1); } if (bsize <= 0) { fprintf(stderr, "Usage: %s -b -f -i -m\n", argv[0]); exit(1); } if (bsize > msize) { fprintf(stderr, "%s: block size specified is greater than file size spec.\n", argv[0]); exit(1); } if ((fd = creat(fname, 0666)) < 0) { fprintf(stderr, "%s: Could not create.\n", fname); exit(1); } srand(time(0L)); if ((buf = malloc(bsize+1)) == NULL) { fprintf(stderr, "Could not allocate %ld bytes of memory.\n", bsize+1); exit(1); } if ((mem = malloc(mempad)) == NULL) { fprintf(stderr, "Could not allocate %ld bytes of memory.\n", mempad); exit(1); } if ((str = malloc(bsize+1)) == NULL) { fprintf(stderr, "Could not allocate %ld bytes of memory.\n", bsize+1); exit(1); } nblocks = msize / bsize; sprintf(str, "%%0%dd", bsize > 32 ? 32 : bsize - 1); for (i = 0; i < nblocks; i++) { sprintf(buf, str, i); if (write(fd, buf, bsize) < 0) { fprintf(stderr, "%s: initial write failed.\n", argv[0]); exit(1); } } close(fd); if ((fd = open(fname, 0)) < 0) { fprintf(stderr, "%s: could not reopen %s.\n", argv[0], fname); exit(1); } for (; iters > 0; iters--) { i = (rand() * rand() * rand() * rand()) % nblocks; i = i >= 0 ? i : i * (-1); /* ensure it's positive */ mem[i % mempad] = 0377; /* fiddle with some mem */ if (lseek(fd, (i * bsize), 0) < 0) /* seek to position */ { fprintf(stderr, "%s: could not seek to block %ld.\n", argv[0], i); exit(1); } if (read(fd, buf, bsize) < 0) { fprintf(stderr, "%s: could not read block %ld.\n", argv[0], i); exit(1); } strncpy(str, buf, bsize); /* move a string around */ if (index(str, '0') == NULL) strcpy(str, "0"); value = strlen(buf); /* look through memory */ value = atoi(buf); /* convert saved number */ if (value != i) fprintf(stderr, "%s: block number mismatch.\n", argv[0]); } } !FUNKYSTUFF! echo "-x mkfile.c" cat >mkfile.c < -s * * Description: * mkfile writes a text file of specified (no default) * of random integers converted into their char representation * into the filename specified (default bench.1). Note that * the actual file size may be a few characters larger than * the exact size specified in order to include a complete * last line. * * Written: * June, 1984 * Medical Systems Development Corporation * */ #include main(argc, argv) int argc; char *argv[]; { long i; long fsize = 0; char buf[513]; char filename[128]; int atoi(); int creat(); int ofd; long value; strcpy(filename, "bench.1"); for (i = 1; i < argc; i++) { if (argv[i][0] == '-') switch(argv[i][1]) { case 's': if ((fsize = atoi(&argv[i][2])) <= 0) { fprintf(stderr, "Bad size spec.\n"); exit(1); } break; case 'f': strcpy(filename, &argv[i][2]); break; default: fprintf(stderr, "Usage: %s -f -s\n", argv[0]); exit(1); } } if (fsize == 0) { fprintf(stderr, "Usage: %s -f -s\n", argv[0]); exit(1); } if ((ofd = creat(filename, 0666)) < 0) { fprintf(stderr, "%s: Cannot open\n", filename); exit(1); } srand(time(0L)); for (i = 0; i < fsize; ) { value = (rand() * rand() * (rand() / 17)) % fsize; sprintf(buf, "%32d\n", (value < 0) ? value * (-1) : value ); if (write(ofd, buf, strlen(buf)) < 0) { perror("Write failed"); exit(2); } i += strlen(buf); } } !FUNKYSTUFF! echo "-x runbench" cat >runbench <>results 2>>results exit 1 fi rm -f \$OBJS echo "" >>results echo "Benchmark run as of \`date\`" >>results echo " Compiles:" >>results make >>/dev/null 2>>/dev/null echo " mkfile:" >>results ; cat c.mkfile >>results 2>>results; rm -f c.mkfile echo " memcpu:" >>results ; cat c.memcpu >>results 2>>results; rm -f c.memcpu echo " memdisk:" >>results ; cat c.memdisk >>results 2>>results; rm -f c.memdisk echo " Building 1MB file:" >>results time mkfile -s1000000 >>results 2>>results echo " Running 1 copy of memcpu:" >>results time memcpu -b128 -i100000 -m300000 >>results 2>>results echo " Running 5 copies of memcpu:" >> results for x in 1 2 3 4 5; do time memcpu -b128 -i100000 -m300000 >>bench.2\$x 2>>bench.2\$x & done wait cat bench.2? >>results 2>>results rm -f bench.2? echo " Running 1 copy of memdisk:" >>results time memdisk -b10000 -i500 -m1000000 -ftmp.1 >>results 2>>results echo " Running 5 copies of memdisk:" >>results for x in 1 2 3 4 5; do time memdisk -b10000 -i500 -m1000000 -ftmp.\$x >>bench.3\$x 2>>bench.3\$x & done wait cat bench.3? >>results 2>>results rm -f bench.3? echo " Running one copy each of memcpu and memdisk:" >>results time memcpu -b128 -i100000 -m300000 >>bench.40 2>>bench.40 & time memdisk -b10000 -i500 -m1000000 -ftmp.0 >>bench.50 2>>bench.50 & wait cat bench.40 bench.50 >>results 2>>results rm -f tmp.0 rm -f bench.40 bench.50 echo " Running 5 copies each of memcpu and memdisk:" >>results for x in 1 2 3 4 5; do time memcpu -b128 -i100000 -m300000 >>bench.4\$x 2>>bench.4\$x & time memdisk -b10000 -i500 -m1000000 -ftmp.\$x >>bench.5\$x 2>>bench.5\$x & done wait for x in 1 2 3 4 5; do echo " pair \$x:" >>results cat bench.4\$x bench.5\$x >>results 2>>results done rm -f tmp.* rm -f bench.4? bench.5? echo " Sorting the 1MB file:" >>results time sort bench.1 -o bench.2 >>results 2>>results rm -f bench.1 bench.2 echo " Benchmark complete \`date\`" >>results !FUNKYSTUFF! echo "-x anal.750.4.1" cat >anal.750.4.1 <anal.750.4.2 <anal.780.4.1 <anal.785.ultrix <anal.awk <>"anal.err" if (2 == split(\$3, musr, ":")) { printf("%6.1f user\t", (musr[1] * 60) + musr[2]) tusr += (musr[1] * 60) + musr[2] busr += (musr[1] * 60) + musr[2] cusr += 1 bcusr += 1 } else { printf("%6.1f user\t", \$3) tusr += \$3 busr += \$3 cusr += 1 bcusr += 1 } if (\$4 != "user") print "Something is wrong with user time..." >>"anal.err" if (2 == split(\$5, msys, ":")) { printf("%6.1f sys\n", (msys[1] * 60) + msys[2]) tsys += (msys[1] * 60) + msys[2] bsys += (msys[1] * 60) + msys[2] csys += 1 bcsys += 1 } else { printf("%6.1f sys\n", \$5) tsys += \$5 bsys += \$5 csys += 1 bcsys += 1 } if (\$6 != "sys") print "Something is wrong with sys time..." >>"anal.err" } END { printf("total elapsed = %8.1f average = %8.1f\n", tela, tela / cela) printf("total user time = %8.1f average = %8.1f\n", tusr, tusr / cusr) printf("total sys time = %8.1f average = %8.1f\n", tsys, tsys / csys) } !FUNKYSTUFF!