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 AAA10939; Tue, 4 May 2004 00:51:29 +0200 (MET DST) 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 AAA10419 for ; Tue, 4 May 2004 00:51:28 +0200 (MET DST) From: Alain.Frisch@ens.fr Received: from nef.ens.fr (nef.ens.fr [129.199.96.32]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i43MpRSH029084 for ; Tue, 4 May 2004 00:51:27 +0200 Received: from clipper.ens.fr (clipper-gw.ens.fr [129.199.1.22]) by nef.ens.fr (8.12.10/1.01.28121999) with ESMTP id i43MpRKx093851 ; Tue, 4 May 2004 00:51:27 +0200 (CEST) Received: from localhost (frisch@localhost) by clipper.ens.fr (8.12.3/jb-1.1) id i43MpOUV024348 ; Tue, 4 May 2004 00:51:25 +0200 (MET DST) X-Authentication-Warning: clipper.ens.fr: frisch owned process doing -bs Date: Tue, 4 May 2004 00:51:23 +0200 (MET DST) X-X-Sender: frisch@clipper.ens.fr Reply-To: Alain.Frisch@ens.fr To: Jacques Carette cc: "'caml-list'" Subject: RE: [Caml-list] Functors In-Reply-To: <005001c4313f$fcb30d70$1b447182@cas.mcmaster.ca> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-milter (http://amavis.org/) X-Miltered: at concorde with ID 4096CCEF.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; alain:01 frisch:01 caml-list:01 functors:01 jacques:01 ocamlopt:01 constants:01 inlining:01 ocamlopt:01 fwiw:01 mli:01 kloc:01 observations:01 crashes:01 slower:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Mon, 3 May 2004, Jacques Carette wrote: > > Do you have an explanation for this fact ? Given that ocamlopt can inline > > function and propagate constants across compilation unit boundaries, what > > kind of extra optimizations do you get with a single compilation unit ? > > It appears to be inlining of functions across compilation unit boundaries > that makes the difference. Well, precisely, ocamlopt can inline accross compilation unit boundaries, so what's the benefit of having a single compilation unit ? > Note that this is second-hand, if people really want to know details, it > would take me a couple of days to get them from the right people. FWIW, I just tried to put all the .ml/.mli of a medium-sized project (18 kloc) into a single file. Observations: - ocamlopt crashes because of a stack overflow; ocamlopt.opt works fine. - compilation is about 3 times slower. - there is no noticeable difference on the runtime performance. -- Alain ------------------- 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