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 LAA22679; Thu, 29 Jul 2004 11:42:42 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA22937 for ; Thu, 29 Jul 2004 11:42:41 +0200 (MET DST) Received: from smtp.cegetel.net (mf01.sitadelle.com [212.94.174.78]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i6T9geEV001542 for ; Thu, 29 Jul 2004 11:42:41 +0200 Received: from warp (unknown [80.125.123.123]) by smtp.cegetel.net (Postfix) with SMTP id 6A82437981; Thu, 29 Jul 2004 11:42:40 +0200 (CEST) Message-ID: <001301c47550$4581bb60$ef01a8c0@warp> From: "Nicolas Cannasse" To: "Daniel Andor" , "Keith Wansbrough" Cc: "Ocaml" References: Subject: Re: [Caml-list] looping recursion Date: Thu, 29 Jul 2004 11:41:48 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Miltered: at nez-perce with ID 4108C690.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; cannasse:01 warplayer:01 caml-list:01 recursion:01 lemme:01 ocamlc:01 usr:01 vanilla:01 usr:01 ocamlopt:01 0.81:01 vanilla:01 implemented:01 extlib:01 enums:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > > Lemme try it out (10^6 elements): > > > > ocamlc: > > rev rev_map version: > > 2 WALL ( 1.19 usr + 0.02 sys = 1.21 CPU) > > vanilla map: > > 7 WALL ( 6.50 usr + 0.09 sys = 6.59 CPU) > > > > ocamlopt: > > rev rev_map version: > > 1 WALL ( 0.81 usr + 0.03 sys = 0.84 CPU) > > vanilla map: > > 2 WALL ( 2.45 usr + 0.02 sys = 2.47 CPU) > > OK, so why is List.map in the OCaml standard library implemented the > vanilla way rather than the rev rev_map way? If it's such a big win, > it seems foolish to have a broken implementation for such a crucial > function. > > (BTW, if you want efficient (and pure) mapping and filtering over long > streams, you should consider using lazy lists. A good compiler (like > GHC) will do the deforestation optimisation, so the list is never even > allocated[1].) > > [1] unless you make use of persistence, of course. > > --KW 8-) I think in this thread both "problems" are resolved by ExtLib : - a fully tail-recursive List module - Enums for lazy lists http://ocaml-lib.sf.net So of course you can still get the pro and cons of having ExtLib implementation being the standard one, but anyone actually have the choice, that's important. The choice is up to OCaml INRIA team, and I don't think any thread - as long and flammy as it could be - would change their opinions. Regards, Nicolas Cannasse ------------------- 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