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 nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 68862BB88 for ; Tue, 2 Aug 2005 08:44:34 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j726iXRS024654 for ; Tue, 2 Aug 2005 08:44:34 +0200 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 IAA12615 for ; Tue, 2 Aug 2005 08:44:33 +0200 (MET DST) Received: from will.iki.fi (will.iki.fi [217.169.64.20]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j726iWs9028904 for ; Tue, 2 Aug 2005 08:44:33 +0200 Received: from [10.0.20.56] (fa-3-0-0.fw.exomi.com [217.169.64.99]) by will.iki.fi (Postfix) with ESMTP id 79E51232; Tue, 2 Aug 2005 09:44:32 +0300 (EEST) Message-ID: <42EF164D.1010201@exomi.com> Date: Tue, 02 Aug 2005 09:44:29 +0300 From: Ville-Pertti Keinonen User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050721) X-Accept-Language: en-us, en MIME-Version: 1.0 To: jtbryant@valdosta.edu Cc: caml-list@inria.fr Subject: Re: [Caml-list] Function Inlining References: <1122931490.3276.16.camel@starlight.valdosta.edu> In-Reply-To: <1122931490.3276.16.camel@starlight.valdosta.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 42EF1651.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 42EF1650.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 inlining:01 -inline:01 ocamlopt:01 inlining:01 inlined:01 ocaml:01 rec:01 ocaml:01 transforming:01 wrote:01 constants:01 constants:01 tail:01 functions:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 Jonathan Bryant wrote: > What is the deal with the -inline option for ocamlopt? I've turned it > off (0), turned it on (1), turned it up (10 - 100) and gone crazy > (10000) with it. Yet my executable says exactly the same size and runs > in exactly the same time. I know inlining functions leads to code > bloating and (usually) performance increases, so I'm confused. Is it > not working? I have both large and small functions so it's not that > they are all getting inlined any time it is on. Besides turning it off > makes no difference. > What's going on here? You're probably running into restrictions other than size that OCaml has on function inlining, such as function definitions inside the function, structured constants and let rec. Getting rid of these restrictions could potentially improve OCaml code generation considerably, but as far as I can tell, that would require some additional features in the code generation such as sharing structured constants, explicitly transforming tail calls to loops etc.