From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id QAA02326; Fri, 3 Jan 2003 16:59:02 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA02292 for ; Fri, 3 Jan 2003 16:58:59 +0100 (MET) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from sm206.163.com ([202.108.44.206]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h03Fwgr01464 for ; Fri, 3 Jan 2003 16:58:51 +0100 (MET) Received: from localhost (localhost [127.0.0.1]) by sm206.163.com (Postfix) with SMTP id BE4481C82F0F1; Fri, 3 Jan 2003 23:58:24 +0800 (CST) Received: from climbxp (unknown [159.226.149.121]) by 192.168.1.206 (Coremail:www.163.com) with SMTP id hwIAAB+zFT4FJZV5.2 for ; Fri, 03 Jan 2003 23:58:24 +0800 (CST) From: "climb" To: "caml-list@inria.fr" Cc: Chet Murthy Subject: Re: Re: [Caml-list] speed X-mailer: Foxmail 4.2 [cn] Mime-Version: 1.0 Content-Type: text/plain; charset="GB2312" Content-Transfer-Encoding: 7bit Date: Fri, 3 Jan 2003 23:58:18 +0800 Message-Id: <20030103155824.BE4481C82F0F1@sm206.163.com> Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk >That said, by and large I find that when you don't go near issues of >allocation and interprocedural optimization, Java is and can be as >fast as Caml. *However*, when you _do_ go near those things, e.g. if >you do anything I/O or string-processing-intensive, well, > > go get a rocking chair, 'cos you're gonna have a looong wait. > I quite agree with it. one part of my program (on bio sequence analyze) is dealing with IO and string- processing. The Ocaml version is amazingly faster than java.( amazing , indeed) . however if comes to other part ( simulation of trees ) the ocaml version is not that fast than java. The factor 2 (in fact) is not quite easy to achieve. especially if contains some recursive types and random numbers ( so,i changed it into Ocamlgsl Gsl_rng.t and using a faster type of rng). I found if i define tree in a recursive way( i have tried both functional style like in the page 50 in O' book and imperative style , using module of node and tree similar with java's node class and tree class), the factor is 1 or so. when i tried to get rid of any recursive definition by using an array to contain nodes and each node only contain index of the children , at this case the factor is 1.8 or 2 . However , i think this trick is somehow a litte ugly . Since i am still quite new to ocaml, can any expert tell me why recursive types reduce the speed ( or my experice above is wrong). Thanks Yours climb onlyclimb@163.com 2003-01-03 ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners