Reply to: speed versus C

From: Jens Olsson (jenso@csd.uu.se)
Date: Wed Oct 06 1999 - 09:58:47 MET DST


From: Jens Olsson <jenso@csd.uu.se>
Date: Wed, 6 Oct 1999 09:58:47 +0200 (MET DST)
To: "Jan Brosius" <jan.brosius@village.uunet.be>
Subject: Reply to: speed versus C
In-Reply-To: <000f01bf0de7$2f626fd0$240cbed4@jannt>

Hello,

On Sun, 3 October 1999 Jan Brosius (jan.brosius@village.uunet.be) wrote=
:
>Hi, is there anything known about the efficiency of compiled Ocaml cod=
e
>compared with C/C++

I'm very interested in this as well. I've made a small program to test
this, namely a ray tracer. Ray tracing as a problem is quite suitable
for functional programming languages and as I have written one in C
too; I wanted to compare. I've now written yet another one in
Ocaml. I'm not entirely finished but my preliminary testing shows
that the tracer written in ML can be not more than 30%-50% slower than
the C version. The C version used to compare with is quite optimized
using various compiler flags and other tricks but they are quite
similar in an algorithmic point of view.

My Ml tracer is written in a quite naive manner (with more concern on
abstractions than speed) so it may/should be possible to speed it up
more. My intention is to 'release' it in order to encourage people to
come with suggestions on how to make it faster and better.

Ok, enough about that. As an answer to your question; Ocaml is *fast*
and by selecting problems suitable for functional languages and by
taking advantage of the features given by them one can get equally
fast or even faster programs than corresponding C programs. I'd love
to have a working example to show any person in doubt and it is my
intention to make one.

regards

Jens Olsson

--
--[ Jens Olsson ]-----------------------------------------------------
  [Address]            [Phone]                 [WWW]
  Dj=E4knegatan 13, 1tr  Home: 018 -  24 88 77   jenso@csd.uu.se     =

754 23 Uppsala Work: 018 - 471 76 85 www.csd.uu.se/~jenso SWEDEN Cell: CEASED!!! ICQ UID 8955231 ---------------------------------[ CS student @ Uppsala University ]--



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