[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Benchmarks



Original-Via: uk.ac.nsf; Sun, 17 Mar 91 23:57:55 GMT
Date: Mon, 18 Mar 91 11:51:35 NZS
From: E.Ireland@massey.ac.nz
To: haskell@edu.yale.cs
Subject: Benchmarks
Sender: haskell-request@cs.glasgow.ac.uk

Hi,

Has anyone prepared a set of benchmark programs for Haskell implementations?
If so, could you please send them to me via email, or perhaps to the mailing
list, if they are small enough or if there is enough interest.

I am more interested in the execution speeds of compiled (or interpreted!)
programs.  Compiled program size and compilation times for larger programs
would also be interesting, but are not my major concern.

For those of you with a Haskell compiler but without a set of benchmarks, I
would appreciate timing figures for the program:

    nfib :: Int -> Int
    nfib n = if n < 2 then 1 else 1 + nfib (n-1) + nfib (n-2)

    main = print (nfib 23)	-- 23 may be too small on faster machines

and also for the C program:

    #include <stdio.h>

    int fib (n)
	int n;
    {
	if (n == 0) return 1;
	else if (n == 1) return 1;
	else return fib (n - 1) + fib (n - 2) + 1;
    }

    main (argc, argv)
	int argc;
	char *argv[];
    {
	printf ("%d\n", fib (23));
    }

The figures I am interested in should look something like:

    Test results for evaluation of fib (26) = 392835 on Sun 3/50
    (Average unix user "time" in seconds)
              Average   nfib/sec
    Lazy FAM  15.0      26189
    C         2.9       135460   (FAM/C ratio 0.19)

    Test results for evaluation of fib (23) = 92735 on Vax 750
    (Unix user "time" in seconds)
              Average   nfib/sec
    Lazy FAM  11.3      8206
    C         3.8       24403    (FAM/C ratio 0.34)

(The Lazy FAM is an intermediate code which is compiled into C, so the FAM/C
ratio gives some idea of the overheads associated with the functional language
implementation).
_______________________________________________________________________________

E.Ireland@massey.ac.nz          Evan Ireland, School of Information Sciences,
  (063) 69-099 x8541          Massey University, Palmerston North, New Zealand.