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 HAA16630; Thu, 31 Jan 2002 07:49:49 +0100 (MET) 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 HAA16972 for ; Thu, 31 Jan 2002 07:49:48 +0100 (MET) Received: from nef.ens.fr (nef.ens.fr [129.199.96.32]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g0V6nlD20932 for ; Thu, 31 Jan 2002 07:49:47 +0100 (MET) Received: from dmi.ens.fr (dmi.ens.fr [129.199.96.11]) by nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id g0V6nll94889 for ; Thu, 31 Jan 2002 07:49:47 +0100 (CET) Received: from basilic.ens.fr (monniaux@basilic [129.199.99.48]) by dmi.ens.fr (8.10.1/jb-1.3-180200) id g0V6nlp29054 for ; Thu, 31 Jan 2002 07:49:47 +0100 (MET) Received: from localhost (monniaux@localhost) by basilic.ens.fr (8.11.0/jb-1.1) id g0V6njl16472 for ; Thu, 31 Jan 2002 07:49:45 +0100 (MET) X-Authentication-Warning: basilic.ens.fr: monniaux owned process doing -bs Date: Thu, 31 Jan 2002 07:49:45 +0100 (MET) From: David Monniaux X-Sender: monniaux@basilic.ens.fr To: Liste CAML Subject: [Caml-list] optimizing functors Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk We are currently writing code containing lots of stacked functors. Most of the implemented functions are simple manipulations (two lines) that invoke functions in the functor's argument module. OCaml does inlining of functions in the same module. Does it also do it between different modules? Would it optimize the following: module M= struct let f = function 0 -> true | _ -> false end module N (D : sig val f: int->bool end) = struct let f = D.f end module P=N(M) Does the compiler optimize the call to f in P, resolving it directly to M.f, or does it do multiple indirections? David Monniaux http://www.di.ens.fr/~monniaux Laboratoire d'informatique de l'École Normale Supérieure, Paris, France ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr