Re: speed versus C

From: Xavier Urbain (
Date: Thu Oct 07 1999 - 14:37:00 MET DST

From: Xavier Urbain <>
Date: Thu, 7 Oct 1999 14:37:00 +0200 (MET DST)
Subject: Re: speed versus C
In-Reply-To: <>

While talking about efficiency of ocaml versus C, I have to say that
as JC-Filliatre said before concerning gmp and num, we tried several
algorithms in order to compute huge fibonacci numbers. We are as
efficient (and in one case much more) as C with nice readable code as
a bonus. Actually most of the time is spent in gmp (far better than num
in THAT case) so... I should put those files on my web page.

Concerning other problems like "solitaire" solver or emacs' mpuz
solver (without any extenal library) we have quite comparable times.

I strongly agree with Gerd Stolpmann when he write that ocaml offer
the opportunity of coding directly (I should add "naturally") more
sophisticated algorithms.

Finally remember that the ocamlopt compiler makes NO OPTIMIZATION (not
even multiplication by constant).
Try then C code compiled without flags such as -O3
-fomit-frame-pointer and so on.



Xavier Urbain --------------------------------------------------------------- L.R.I., Bât 490 mailto: Université de Paris-Sud phoneto: (33) 1 69 15 42 32 F-91405 Orsay cedex faxto: (33) 1 69 15 65 86 ---------------------------------------------------------------

This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:26 MET