Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
OCaml troll on Slashdot
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Yoann Padioleau <padiolea@i...>
Subject: Re: [Caml-list] OCaml troll on Slashdot
Jon Harrop <> writes:

> On Tuesday 15 March 2005 08:45, Michael Vanier wrote:
> > Maybe he hasn't discovered ocamlopt yet.
> No, the OCaml code (compiled with ocamlopt) is much, much slower than the C++. 
> As we all know, this can mean only one thing...
> Also, his C++ is actually shorter than the OCaml, and the OCaml defines a lot 
> of familiar looking functions (map, length, "prepend" etc.).
> I'll take a more detailed look in a minute...

I have made the obvious optimization which is to replace the assoc list by 
a Map (just changing 4 lines in the "troll" code),
the ocaml version is then far far faster.

But computing 7 by 7 with c++ take 1.5 sec and with 
ocaml 50.0 sec (but it is better than "more than 16 minutes").

Yoann  Padioleau,  INSA de Rennes, France
Opinions expressed here are only mine. Je n'écris qu'à titre personnel.
**____   Get Free. Be Smart.  Simply use Linux and Free Software.   ____**