From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 236BEBC0B for ; Thu, 7 Dec 2006 11:43:06 +0100 (CET) Received: from rwcrmhc12.comcast.net (rwcrmhc12.comcast.net [204.127.192.82]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id kB7Ah5LE002524 for ; Thu, 7 Dec 2006 11:43:05 +0100 Received: from [10.0.1.5] (c-67-188-3-155.hsd1.ca.comcast.net[67.188.3.155]) by comcast.net (rwcrmhc12) with SMTP id <20061207104303m1200s9di8e>; Thu, 7 Dec 2006 10:43:04 +0000 Mime-Version: 1.0 (Apple Message framework v749.3) In-Reply-To: <613020E3-8A60-4FA9-975E-F2AD5E0E28DB@epfl.ch> References: <4C40AFBA-AE30-4C22-B2A5-170FDA130B64@lrde.epita.fr> <613020E3-8A60-4FA9-975E-F2AD5E0E28DB@epfl.ch> Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed Message-Id: <8E63D477-08E0-485C-A250-6E90A699A253@lrde.epita.fr> Content-Transfer-Encoding: quoted-printable From: =?ISO-8859-1?Q?Qu=F4c_Peyrot?= Subject: Re: [Caml-list] time profiling and nested function inlining Date: Thu, 7 Dec 2006 02:43:01 -0800 To: caml-list@inria.fr X-Mailer: Apple Mail (2.749.3) X-Miltered: at discorde with ID 4577F039.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; lrde:01 inlining:01 bunzli:01 compiler:01 ocamlopt:01 invoke:01 wrote:01 macosx:01 compile:01 caml-list:01 len:02 len:02 output:02 -ccopt:03 executable:03 On Dec 6, 2006, at 12:55 AM, Daniel B=FCnzli wrote: > If you have the development tools installed, you can profile on =20 > macosx using shark (you don't even need to compile with -p). Invoke =20= > it from the command line on your executable as follows: > > > shark -i -1 -q ./yourexec.opt args > > This will write a .mshark file in the directory that you can open =20 > with Shark.app. > > > open *.mshark Thanks, it worked like a charm. Anyone for my second question from my original email (about the =20 nested function)? The more I look at the assembly output, the more I am puzzled. =20 Another simple example: for i =3D 0 to len - 1 do for j =3D 0 to len - 1 do array.(i).(j) <- 0; done; done; doesn't seem to be equivalent to for i =3D 0 to len - 1 do let array_i =3D array.(i) in for j =3D 0 to len - 1 do array_i.(j) <- 0; done; done; in the former, the compiler doesn't detect the invariant "array.(i)" =20= and keeps it inside the inner loop. I tried to pass -ccopt -O3 to ocamlopt but it didn't seem to change =20 anything. --=20 Best Regards, Qu=F4c