Subject: Permutations Test-Case: Haskell vs. C Benchmarks

From: Shlomi Fish <[email-masked]>
Date: Wed, 23 Jan 2002 08:45:40 +0200 (IST)

I benchamrked the Haskell and C programs for 5 ** 10 with time:

The C dump:
8.01user 0.04system 0:08.12elapsed 99%CPU
(0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (92major+15minor)pagefaults 0swaps

The Haskell dump:
69.41user 0.19system 1:10.02elapsed 99%CPU (0avgtext+0avgdata
0maxresident)k
0inputs+0outputs (143major+269minor)pagefaults 0swaps

As you can see, the Haskell program performs much worse. But then
again, it uses a slightly different algorithm. I think the Lazy
evalutation should have taken care of that. Furthermore, a similar Haskell
program I wrote that tries to resemble the C program seems to take even
longer. (3:22 minutes !)

I did not implement Adi's variation in Haskell, yet. But it is obviously a
different algorithm, and I'm a bit tired of having to think of new
algorithms for use in Haskell, instead of being able to write the
algorithms in Haskell, with perhaps some minor adaptations.

Regards,

	Shlomi Fish

----------------------------------------------------------------------
Shlomi Fish        [email-masked]
Home Page:         http://t2.technion.ac.il/~shlomif/
Home E-mail:       [email-masked]

"Let's suppose you have a table with 2^n cups..."
"Wait a second - is n a natural number?"