[ont.micro.mac] Macpascal Benchmark

info-mac@utcsrgv.UUCP (info-mac) (07/04/84)

Date: Tue 3 Jul 84 19:09:25-PDT
From: Stuart Reges <uw-beaver!REGES@SU-SCORE.ARPA>
Subject: MacPascal Benchmark
To: info-mac@SU-SCORE.ARPA
Office: Margaret Jacks 210, 497-9798

A simple Pascal benchmark is given by the recursive fibonnaci calculation:

	program Fibonnaci (input, output);
	var number: integer;

	function fib (arg: integer): integer;
	begin
	    if arg <= 2 then fib := 1
	    else fib := fib (arg - 1) + fib (arg - 2);
	end;

	begin
	    repeat
		write ('number (0 to stop) ---> ');
		readln (number);
		if number <> 0 then writeln ('answer = ', fib (number));
	    until number = 0;
	end.

This benchmark involves addition and a lot of function calls.  The complexity
of this calculation is (phi)^n where phi = golden ratio = (SQRT(5) + 1)/2.  A
nice property of this benchmark is that every time you increase "n" by 5 you
increase the complexity by a factor of about 11.

Here are some figures I got from three different systems that will be used for
instruction at Stanford next Fall:

	"n"	Waterloo	MacPascal	MacPascal	DEC-20 Pascal
		Interpretter	(integer)	(longint)	Compiled
	-----------------------------------------------------------------------
	15	 50 seconds	 6.7 seconds	  5.9 seconds	
	20	540 seconds	70.5 seconds	 63.5 seconds	 0.2 seconds
	25					702.0 seconds	 1.7 seconds
	30							19.7 seconds

The Waterloo Pascal Interpretter runs on an IBM/PC.  The MacPascal version
using INTEGER could not calculate FIB (25) because it is greater then MAXINT.
I don't know why the LONGINT version should be faster.  That is
counter-intuitive for me.  The DEC-20 Pascal is Hedricks compiler from Rutgers.
The time reported is actual CPU time.  Other calculations were done with a
wrist-watch, but should be accurate to within a quarter second.

This is using the Beta version of MacPascal released last week.
-------

info-mac@utcsrgv.UUCP (info-mac) (07/05/84)

Date:     4 Jul 84 17:06:13-CDT (Wed)
From: Alan T Krantz <uw-beaver!atk%vanderbilt.csnet@csnet-relay.arpa>
To: info-mac%su-score@csnet-relay.arpa
Subject:  re: Macpascal Benchmark

I ran the Fib. bench mark on an IBM PC with TURBO pascal (version 2.0) to 
see how well the Macintosh interpreted pascal would perform on my everyday
applications. The following are my results:


"n"   Time (in sec)
15        .22
20       1.75
25      18.20
30     192.00

All times were timed with a wrist watch and should be accurate to the nearest
second. An overflow occured when N = 25, however overflow detection was
turned off so this should not have affected the timing. 

							Alan T. Krantz
							atk@vanderbilt