From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id q2DM2ESn007158 for ; Tue, 13 Mar 2012 23:02:14 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnEDAHDCX0/Dxax0lGdsb2JhbABDtW8iAQEBAQkLEhQDJIIJAQEEATo/BQsLDiYSFBgxiBgJu1uQE2MElU+TCw X-IronPort-AV: E=Sophos;i="4.73,579,1325458800"; d="scan'208";a="149195010" Received: from gw02.mail.saunalahti.fi ([195.197.172.116]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 13 Mar 2012 23:02:09 +0100 Received: from tanssi.net (a91-153-81-212.elisa-laajakaista.fi [91.153.81.212]) by gw02.mail.saunalahti.fi (Postfix) with ESMTP id 12120176188; Wed, 14 Mar 2012 00:02:04 +0200 (EET) Received: by tanssi.net (Postfix, from userid 268) id E90A55A1255; Wed, 14 Mar 2012 00:02:02 +0200 (EET) Date: Wed, 14 Mar 2012 00:02:02 +0200 To: Raphael Proust Cc: SerP , caml-list Message-ID: <20120313220202.GA29196@kiuru> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) From: moj@tanssi.net (Matti Jokinen) Subject: Re: [Caml-list] Very slow compilation > When working with ocamlduce (a few years ago) the same problem was > raised. A simple thing that can greatly reduce typing time is putting > explicit type annotations. Although the verbosity is increased it is > not that much of a burden if the annotated parts do not evolve too > much. In my experience, ocamlduceopt/ocamlduceopt.opt slows down regularly when the source file approaches 1000 lines of OCamlDuce code. The compilation time then grows rapidly: in this machine (Thinkpad R5000) 1000 lines took 20 seconds, 2000 lines 2 minutes, 3000 lines hanged the system. Only OCamlDuce code causes slowdown, pure OCaml is compiled rapidly even by OCamlDuce compilers. However, it is not typechecking that takes time. The time-consuming step appears to be register allocation. Try: ocamldebug /usr/bin/ocamlduceopt -c big_ocamlduce_module.ml run ... wait about two minutes and press control-C You will probably find the compiler executing a function from modules such as Interf, Coloring or Spill, or a lower level function called from these modules. I have never observed anything similar in OCaml, but ocamlduceopt appears to use unmodified ocamlopt code generation modules. I wonder what is the critical difference between OCamlDuce code and typical OCaml code at this level. - Matti Jokinen