From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 1AD95BC32 for ; Tue, 15 Mar 2005 21:17:19 +0100 (CET) Received: from ryxa.irisa.fr (ryxa.irisa.fr [131.254.50.45]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j2FKHIXE009812 for ; Tue, 15 Mar 2005 21:17:18 +0100 Received: (from pad@localhost) by ryxa.irisa.fr (8.11.6/8.11.6) id j2FKHHC02114; Tue, 15 Mar 2005 21:17:17 +0100 X-Authentication-Warning: ryxa.irisa.fr: pad set sender to padiolea@irisa.fr using -f Sender: pad@ryxa.irisa.fr To: Jon Harrop Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] OCaml troll on Slashdot References: <42363A86.6010309@1969.ws> <20050315083243.GO321@first.in-berlin.de> <20050315084529.E562F1880C3@orchestra.cs.caltech.edu> <200503150859.55997.jon@ffconsultancy.com> From: Yoann Padioleau Date: 15 Mar 2005 21:17:16 +0100 In-Reply-To: <200503150859.55997.jon@ffconsultancy.com> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Miltered: at nez-perce with ID 423742CE.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocaml:01 irisa:01 vanier:01 ocamlopt:01 ocaml:01 ocamlopt:01 defines:01 prepend:01 rennes:01 irisa:01 ...:98 ...:98 1.5:98 wrote:01 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: 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 www.irisa.fr/prive/padiolea/ Opinions expressed here are only mine. Je n'écris qu'à titre personnel. **____ Get Free. Be Smart. Simply use Linux and Free Software. ____**