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 WAA05932; Wed, 4 Jun 2003 22:23:26 +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 WAA06152 for ; Wed, 4 Jun 2003 22:23:25 +0200 (MET DST) Received: from sockmel.bononia.it (sockmel.bononia.it [193.201.40.5]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h54KNPT12886 for ; Wed, 4 Jun 2003 22:23:25 +0200 (MET DST) Received: from fistandantilus.takhisis.org (sockmel.bononia.it [193.201.40.5]) by sockmel.bononia.it (Postfix) with ESMTP id BA10F56EF1 for ; Wed, 4 Jun 2003 22:23:23 +0200 (CEST) Received: by fistandantilus.takhisis.org (Postfix, from userid 3148) id 8311F274074; Wed, 4 Jun 2003 22:23:17 +0200 (CEST) Date: Wed, 4 Jun 2003 22:23:17 +0200 From: Stefano Zacchiroli To: caml-list@inria.fr Subject: Re: [Caml-list] Re: yet another benchmark: List.map vs tail recursive map Message-ID: <20030604202317.GF18515@fistandantilus.takhisis.org> Mail-Followup-To: caml-list@inria.fr References: <20030604120011.GA12262@fistandantilus.takhisis.org> <20030604.171327.37652101.debian00@tiscali.be> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030604.171327.37652101.debian00@tiscali.be> User-Agent: Mutt/1.5.4i X-Spam: no; 0.00; bononia:01 caml-list:01 troestler:01 recursion:01 slower:01 christophe:01 bytecode:01 terribly:01 0200,:01 benchmark:02 compile:02 native:02 bologna:03 04,:03 wrote:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, Jun 04, 2003 at 05:13:27PM +0200, Christophe TROESTLER wrote: > Given this, it rather seems that List.map is fine -- for if one really > wants speed, one will compile to native code and the bytecode version My point is not having speed, but rather having tail recursion. In many cases lists are the correct data structure even for "a lot of elements". I've always thought that tail recursive version of map would have been terribly slower than not tail recrusive one due to the additional reversal. But since this is not the case (or at least the shown figures don't fit my idea of "terribly"), why keep on using the not tail recursive one? Cheers. -- Stefano Zacchiroli -- Master in Computer Science @ Uni. Bologna, Italy zack@{cs.unibo.it,debian.org,bononia.it} - http://www.bononia.it/zack/ " I know you believe you understood what you think I said, but I am not sure you realize that what you heard is not what I meant! " -- G.Romney ------------------- 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