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 SAA21915; Mon, 3 May 2004 18:36:35 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 SAA22081 for ; Mon, 3 May 2004 18:36:33 +0200 (MET DST) Received: from newext.lri.fr (ext.lri.fr [129.175.15.4]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i43GaXSH003269 for ; Mon, 3 May 2004 18:36:33 +0200 Received: from serveur-mail.lri.fr (serveur-mail [129.175.8.90]) by newext.lri.fr (8.12.10/jtpda-5.4) with ESMTP id i43G2kBG028557 ; Mon, 3 May 2004 18:02:46 +0200 (MEST) Received: from pc8-119.lri.fr (pc8-119 [129.175.8.119]) by serveur-mail.lri.fr (8.11.6p2/jtpda-5.3.2) with ESMTP id i43G2jq21897 ; Mon, 3 May 2004 18:02:45 +0200 (MEST) Received: from localhost ([127.0.0.1]) by pc8-119.lri.fr with esmtp (Exim 3.36 #1 (Debian)) id 1BKfu1-00058A-00; Mon, 03 May 2004 18:02:45 +0200 Date: Mon, 3 May 2004 18:02:45 +0200 (MEST) From: Julien Signoles To: Jon Harrop cc: caml-list@inria.fr Subject: Re: [Caml-list] Functors In-Reply-To: <200405021434.22102.jdh30@cam.ac.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner: Found to be clean X-Miltered: at concorde with ID 40967511.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; signoles:01 signoles:01 lri:01 caml-list:01 functors:01 ocamldefun:01 functors:01 inlining:01 ocamldefun:01 inlined:01 functorized:01 lri:01 mcvoy:01 compiler:01 compiler:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > Wow, ok. So ocamldefun maps ocaml code with functors onto ocaml code without > functors and, according to their examples, this can result in an 8 times > performance improvement due to inlining. As far as I test ocamldefun, performance improvement is very dependent of the application. Mainly, the defunctorized code is generally much more efficient than the code with functors if (1) some functions are not inlined due to functors; and (2) these functions are called very often. Generally, in the others case, the defunctorization do not improve performance a lot. > This begs the question: why is this functionality not in the compiler? In > fact, using functors with the current compiler actually reduces > performance... Some SML compilers include a defunctorizer... But, in a lot of cases, functors do not reduce performance a lot (as explained above). Morever, static analysis tools do not generally correctly work on functorized programs: so a source-to-source defunctorizer as ocamldefun can be used by these tools while a defunctorizer directly included in the compiler cannot. So i'm not sure including a defunctorizer in the compiler is a good thing... Cheers, Julien Signoles -- mailto:Julien.Signoles@lri.fr ; http://www.lri.fr/~signoles "In theory, practice and theory are the same, but in practice they are different" (Larry McVoy) ------------------- 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