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 PAA26940; Sun, 2 May 2004 15:34:46 +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 PAA26844 for ; Sun, 2 May 2004 15:34:45 +0200 (MET DST) Received: from ptb-relay02.plus.net (ptb-relay02.plus.net [212.159.14.213]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i42DYiSH029680 for ; Sun, 2 May 2004 15:34:44 +0200 Received: from [80.229.56.224] (helo=chetara) by ptb-relay02.plus.net with esmtp (Exim) id 1BKH7D-0003jS-V8 for caml-list@inria.fr; Sun, 02 May 2004 13:34:44 +0000 From: Jon Harrop Organization: University of Cambridge To: caml-list@inria.fr Subject: Re: [Caml-list] Functors Date: Sun, 2 May 2004 14:34:22 +0100 User-Agent: KMail/1.5.4 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200405021434.22102.jdh30@cam.ac.uk> X-Miltered: at concorde with ID 4094F8F4.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 functors:01 2004:99 functors:01 functor:01 lri:01 signoles:01 ocamldefun:01 ocamldefun:01 inlining:01 compiler:01 compiler:01 ocaml:01 ocaml:01 partially:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Sunday 02 May 2004 11:24, Martin Jambon wrote: > On Sun, 2 May 2004, Jon Harrop wrote: > > Functors appear to be somewhat similar to templates in C++. Does the > > functor approach produce more efficient code as it is partially > > specialised over the comparison function? > > Unfortunately no. > ... > http://www.lri.fr/~signoles/ocamldefun/manual.html 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. This begs the question: why is this functionality not in the compiler? In fact, using functors with the current compiler actually reduces performance... Cheers, Jon. ------------------- 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