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 LAA04728; Tue, 28 Sep 2004 11:32:17 +0200 (MET DST) 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 LAA05740 for ; Tue, 28 Sep 2004 11:32:15 +0200 (MET DST) Received: from mta1.cl.cam.ac.uk (mta1.cl.cam.ac.uk [128.232.0.15]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id i8S9WFit027014 for ; Tue, 28 Sep 2004 11:32:15 +0200 Received: from zonule.cl.cam.ac.uk ([128.232.9.23] helo=cl.cam.ac.uk ident=[FfvYP4YV0b7yqcIPJlRowZpS0HJfSPTE]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1CCEL8-00012D-00; Tue, 28 Sep 2004 10:32:06 +0100 X-Mailer: exmh version 2.6.3-CL 04/04/2003 with nmh-1.0.4 X-Exmh-Isig-CompType: repl X-Exmh-Isig-Folder: cslists/caml To: "Rafael 'Dido' Sevilla" cc: John Goerzen , caml-list@inria.fr Subject: Re: [Caml-list] Observations on OCaml vs. Haskell In-reply-to: Your message of "Tue, 28 Sep 2004 04:24:49 +0800." <20040927202449.GA548@imperium.ph> Mime-Version: 1.0 Content-Type: text/plain Date: Tue, 28 Sep 2004 10:31:31 +0100 From: Keith Wansbrough Message-Id: X-Miltered: at concorde with ID 41592F9F.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 observations:01 haskell:01 slower:01 shootout:01 haskell:01 scoring:01 slower:01 shootout:01 boxing:01 unboxing:01 unicode:01 ocaml:01 ocaml:01 bytecode:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > and both languages seem to be significantly slower than OCaml in string > handling, at least as far as this site goes: > > http://shootout.alioth.debian.org/ > > For the word count benchmark OCaml scores 0.1850 seconds, while GHC is a > dismal last place at 105.2110 seconds! Even the bytecode ocaml is an > order of magnitude faster. The word frequency benchmark also shows this > kind of poor string handling performance for Haskell, with OCaml scoring > 0.5669 seconds, while GHC scores a truly dismal 6.4540, more than an > order of magnitude slower, and even the bytecode ocaml is faster at > 4.2644 seconds. I severely doubt that these times are representative - the shootout doesn't claim to be serious or meaningful. A factor of ten is possible, but a factor of 1000 shows that something else is wrong. But it's true that for text-handling performance in GHC you have to use something other than list-of-Char; typically you use PackedString, which is basically an array of bytes. The boxing and unboxing certainly has significant cost. Note that GHC characters are Unicode, and stored in 32 bits; OCaml characters are only 8 bits wide, and so OCaml has a 4x advantage right away - but loses the potential for i18n. HTH. --KW 8-) ------------------- 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