From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 4CFABBDC5 for ; Mon, 22 Aug 2005 18:03:43 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j7MG3gBL031869 for ; Mon, 22 Aug 2005 18:03:43 +0200 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 SAA31035 for ; Mon, 22 Aug 2005 18:03:42 +0200 (MET DST) Received: from cgpsrv2.cis.mcmaster.ca (univmail.CIS.McMaster.CA [130.113.64.46]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j7MG3f7s031866 for ; Mon, 22 Aug 2005 18:03:42 +0200 Received: from [130.113.68.27] (account carette@univmail.cis.mcmaster.ca [130.113.68.27] verified) by cgpsrv2.cis.mcmaster.ca (CommuniGate Pro SMTP 4.1.8) with ESMTP id 101766501 for caml-list@inria.fr; Mon, 22 Aug 2005 12:03:41 -0400 Message-ID: <4309F764.9050409@mcmaster.ca> Date: Mon, 22 Aug 2005 12:03:48 -0400 From: Jacques Carette User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: caml-list@inria.fr Subject: Compilation speed of modules/functors Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 4309F75E.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 4309F75D.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; compilation:01 functors:01 compilation:01 functors:01 pitfalls:01 metaocaml:01 ocaml:01 metaocaml:01 extensible:01 modules:01 modules:01 jacques:01 jacques:01 mcmaster:02 mcmaster:02 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 Are there known issues with compilation speed of heavily functorized code? My code used to use a lot of records, but that was not very extensible, so I switched to using modules and functors. Now the compilation time has gone from << 1 second to 5-6 seconds (on my slow laptop). While not the end of the world, this still surprised me. Are there known issues in this area? Known pitfalls and work-arounds? The actual codes are in MetaOCaml, but I did some experiments in pure Ocaml and got the same results, so it is not due to MetaOCaml (sorry, these are no longer available). The curious can look at http://www.metaocaml.org/examples/gausselim/ for record-based code and http://www.cas.mcmaster.ca/~carette/metamonads/ for functor-based code. Jacques