From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id AE05EBB81 for ; Fri, 24 Feb 2006 20:25:29 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id k1OJPS5w020814 for ; Fri, 24 Feb 2006 20:25:29 +0100 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 UAA08752 for ; Fri, 24 Feb 2006 20:25:28 +0100 (MET) Received: from mail.barettadeit.com (h213-255-109-130.albacom.net [213.255.109.130] (may be forged)) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id k1OJPRI0020811 for ; Fri, 24 Feb 2006 20:25:28 +0100 Received: from [10.0.0.10] (alex.barettalocal.com [10.0.0.10]) by mail.barettadeit.com (Postfix) with ESMTP id 590EAA54BC; Fri, 24 Feb 2006 20:26:09 +0100 (CET) Message-ID: <43FF5DA6.6000600@studio.baretta.com> Date: Fri, 24 Feb 2006 20:25:26 +0100 From: Alessandro Baretta User-Agent: Debian Thunderbird 1.0.7 (X11/20051017) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Anil Madhavapeddy Cc: Ocaml Subject: Re: [Caml-list] Question on performance/style issue References: <43FF2BC9.6030503@studio.baretta.com> <20060224190501.GA27740@fork.recoil.org> In-Reply-To: <20060224190501.GA27740@fork.recoil.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 43FF5DA9.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 43FF5DA7.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; baretta:01 baretta:01 caml-list:01 anil:01 bindings:01 ocaml:01 ingegneria:98 wrote:01 loops:02 programming:03 alessandro:03 alessandro:03 alex:03 latter:03 let:03 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.3 Anil Madhavapeddy wrote: >>>x ++ f ++ g ++ h >> >>What is the impact of the this programming style on execution performance? > > >>>From a GC point of view, this is better than the alternative of > splitting up the calls into separate let bindings. It's used in > the OCaml sources to make some long call-chains look nicer. Ah, yes, it makes one's code dense and legible at once. What I'm asking is whether the call to (++) manages to get compiled away--that is, reduced to its definition--or if I pay for the additional jump every time. In this latter case I might have to renounce the (++) operator in inner loops where I need to squeeze out every last bit of performance. Alex -- ********************************************************************* Ing. Alessandro Baretta Studio Baretta http://studio.baretta.com/ Consulenza Tecnologica e Ingegneria Industriale Technological Consulting and Industrial Engineering tel. +39 02 370 111 55 fax. +39 02 370 111 54