From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 7A351BC48 for ; Tue, 15 Mar 2005 11:03:58 +0100 (CET) Received: from fltrp.com ([218.247.244.2]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j2FA3kBE010342 for ; Tue, 15 Mar 2005 11:03:54 +0100 Received: from kaitiany [192.168.15.11] by fltrp.com with ESMTP (SMTPD32-8.05) id A3FE5AB01D2; Tue, 15 Mar 2005 18:07:58 +0800 From: YANG Shouxun Organization: FLTRP To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] OCaml troll on Slashdot Date: Tue, 15 Mar 2005 18:08:34 +0800 User-Agent: KMail/1.7.2 References: <42363A86.6010309@1969.ws> <20050315092502.GA19351@furbychan.cocan.org> In-Reply-To: <20050315092502.GA19351@furbychan.cocan.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200503151808.34994.yang.shx@fltrp.com> X-Miltered: at concorde with ID 4236B302.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; shouxun:01 fltrp:01 caml-list:01 ocaml:01 hash:01 ocaml:01 argv:01 ocamlopt:01 shx:98 25,:98 wrote:01 wrote:01 parameters:02 optimization:03 sys:03 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: On Tuesday 15 March 2005 17:25, Richard Jones wrote: > On Mon, Mar 14, 2005 at 05:29:42PM -0800, Karl Zilles wrote: > > http://developers.slashdot.org/article.pl?sid=05/03/14/2258219 > > The problem was with his stupid implementation of a hash table: > > http://developers.slashdot.org/comments.pl?sid=142494&cid=11939530 > > (That comment is +5 informative) No. My experiments show that the OCaml implementation performs far better than the C++ implementation when the column and row get larger: C++ is compiled with -O3, not sure what is the better optimization level, while OCaml version (actually I used Sys.argv and references to the two parameters) is compiled with ocamlopt 4x4 c++ real 0m0.003s user 0m0.002s sys 0m0.002s 4x4 ocaml real 0m0.177s user 0m0.137s sys 0m0.001s 8x8 c++ real 0m8.703s user 0m7.000s sys 0m0.018s 8x8 ocaml real 0m0.747s user 0m0.485s sys 0m0.002s 12x12 c++ the process was killed by the OS 12x12 ocaml real 0m1.210s user 0m0.886s sys 0m0.001s