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 KAA26986; Mon, 12 Jul 2004 10:08:03 +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 KAA26625 for ; Mon, 12 Jul 2004 10:08:02 +0200 (MET DST) Received: from beaune.inria.fr (beaune.inria.fr [128.93.8.3]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i6C881SH019966 for ; Mon, 12 Jul 2004 10:08:01 +0200 Received: by beaune.inria.fr (8.8.8/1.1.22.3/14Sep99-0328PM) id KAA0000029139; Mon, 12 Jul 2004 10:08:00 +0200 (MET DST) Date: Mon, 12 Jul 2004 10:08:00 +0200 From: Luc Maranget To: Norman Ramsey Cc: ocaml Subject: Re: [Caml-list] Does Caml have slow arithmetics ? Message-ID: <20040712100800.A28456@beaune.inria.fr> References: <20040707145803.GB27498@yquem.inria.fr> <1089227778.29648.81.camel@pelican.wigram> <20040708034455.GB29942@davidb.org> <40ED190E.3080005@ps.uni-sb.de> <20040708140408.GA2386@davidb.org> <20040708163653.A1260@beaune.inria.fr> <40ED6424.7090903@baretta.com> <20040708174906.B3687@beaune.inria.fr> <20040709175450.E45F21EB1B9@labrador.eecs.harvard.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20040709175450.E45F21EB1B9@labrador.eecs.harvard.edu>; from nr@eecs.harvard.edu on Fri, Jul 09, 2004 at 01:54:50PM -0400 X-Miltered: at concorde with ID 40F246E1.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 arithmetics:01 ocamlc:01 ocamlopt:01 callee:01 unoptimized:01 decl:01 lbls:01 decl:01 lbls:01 wee:99 avoiding:01 unbounded:01 unbounded:01 short-lived:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > > + ocamlc does perform tail call elimation > > + ocamlopt does it less often. Namely, calls in tail position > > become real tail calls when all their arguments are passed in register s. > > (This does not apply to self-tail calls which are always optimized) > > > > In fact you need 7 arguments or more in the callee to > > trigger the unoptimized behavior on a pentium (just checked this time)... > > > > Do not take it that bad. In practice, it does not matter much I guess. > > Hmm. Guess I'm shooting myself in the foot with this code (and lots > more like it): > > let rec decl r imps exports lbls ks consts types regs archs data d k = match d with > | A.DeclAt(x,r) -> decl r imps exports lbls ks consts types regs archs data x k > | A.Typedef d -> k imps exports lbls ks consts ((r,d) :: types) regs archs data ... > > It's a wee bit depressing---I had hoped to treat a function call as a > goto while avoiding unbounded stack growth or unnecessary heap > allocation... What I exactely meant was that ``unbounded stack growth or unnecessary heap allocation'' may not be as bad as it may seem. Especially as regards heap allocation, provided allocated objects are short-lived. --Luc ------------------- 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