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 SAA14260; Fri, 9 Jul 2004 18:20:06 +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 SAA14043 for ; Fri, 9 Jul 2004 18:20:05 +0200 (MET DST) Received: from fichte.ai.univie.ac.at (fichte.ai.univie.ac.at [131.130.174.156]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i69GK3SH014352 for ; Fri, 9 Jul 2004 18:20:04 +0200 Received: from fichte.ai.univie.ac.at (markus@localhost [127.0.0.1]) by fichte.ai.univie.ac.at (8.12.3/8.12.3/Debian-6.6) with ESMTP id i69GK2Du011705; Fri, 9 Jul 2004 18:20:02 +0200 Received: (from markus@localhost) by fichte.ai.univie.ac.at (8.12.3/8.12.3/Debian-6.6) id i69GK1UT011704; Fri, 9 Jul 2004 18:20:01 +0200 Date: Fri, 9 Jul 2004 18:20:01 +0200 From: Markus Mottl To: Alex Baretta Cc: Ocaml Subject: Re: [Caml-list] Does Caml have slow arithmetics ? Message-ID: <20040709162001.GB6031@fichte.ai.univie.ac.at> Mail-Followup-To: Alex Baretta , Ocaml 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> <40EEA66A.6090900@baretta.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <40EEA66A.6090900@baretta.com> User-Agent: Mutt/1.4.1i X-Miltered: at concorde with ID 40EEC5B3.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 arithmetics:01 baretta:01 tail-call:01 ocamlopt:01 tail-call:01 recursion:01 caml:01 feasible:01 alex:01 mottl:02 mottl:02 stack:02 heap:03 heap:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Fri, 09 Jul 2004, Alex Baretta wrote: > I'll have to verify that nowhere in my code do I use functions with more > than seven arguments. If need be, I'll have to compact the arguments > into tuples or records so as to stay within the tail-call optimization > limit. Yet, although this is feasible and probably will have a minimal > impact on my code, I still believe that ocamlopt should do anything it > can to perform proper tail-call optimization all the time. I disagree here, because this would lead to inefficiencies. Throwing things on the stack is still much more efficient than heap allocation. Since the OCaml-compiler can never rule out potential recursion (think of references containing functions, etc.), it would always have to use heap allocation with functions having more than six parameters. I do have some functions that take more than six parameters, but none of them is recursive. It would be pointless to make calling these functions less efficient, only because IA-32 sucks. Regards, Markus -- Markus Mottl http://www.oefai.at/~markus markus@oefai.at ------------------- 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