Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!linus!philabs!cmcl2!seismo!brl-tgr!tgr!fouts@AMES-NAS.ARPA From: fouts@AMES-NAS.ARPA (Marty) Newsgroups: net.micro Subject: Re: Z-100 vs IBM-AT Challenge Update Message-ID: <10787@brl-tgr.ARPA> Date: Fri, 17-May-85 13:01:18 EDT Article-I.D.: brl-tgr.10787 Posted: Fri May 17 13:01:18 1985 Date-Received: Sun, 19-May-85 08:13:43 EDT Sender: news@brl-tgr.ARPA Lines: 63 No. There is no such thing as a single "perfect" benchmark. Especially for computational throughput. For example, the code attached to the end of this note is an excelent example of a heavily optimized variation of one of the more common prime number generator algorithms (which isn't the fastest, provided you have enough memory). However, the only "computations" it does are integer divisions and multiplies. It doesn't do any floating point arithmetic. I have done versions of this algorithm in many languages on 8, 16, 32 and 64 bit machines ranging in size from an SBC Z80 to a Cray 2. In fact, this version in C will run faster on a Vax 11/780 under Berkeley 4.2 Unix than it will on a Cray X-mp 12 under COS, because on the Cray X-mp, the time to load the program into memory greatly dominates the time to do this computation. The point is, there isn't any single benchmark which will tell you that machine A is better than machine in B, because at best "better" (or faster) is a partial ordering and depends on the job mix. If you intend to use the machine to only do integer mulitply / divide operations in a one to one mix, then perhaps prime number generation is a good measure. Otherwise it is at best a rule of thumb estimator. Marty /* * Yet Another Prime number generator */ #define MAXPRIME 3300 #define MAXN 32767 int index, dividend, product, n = 5, nprime = 1, prime[MAXPRIME] = {2, 3}; main() { for ( ; (nprime < MAXPRIME-1) && (n <= MAXN); n += 2) { for (index = 1, dividend = n ; (index < nprime) && (dividend > prime[index]); index++) if ((product = (dividend = n / prime[index]) * prime[index]) == n) break; if (product != n) prime[++nprime] = n; } printf("There are %d primes less than %d. The largest is %d.\n", nprime + 1, n, prime[nprime]); } ----------