From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id q2DMklpc008249 for ; Tue, 13 Mar 2012 23:46:47 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AokEAFzNX0/U4xEIk2dsb2JhbABDpCWRSiIBAQEBCQkUFAMkggkBAQQBbgsFCwUGDhchRRIGEwkIAYdzCQe7P5B2BI1QF5py X-IronPort-AV: E=Sophos;i="4.73,579,1325458800"; d="scan'208";a="135917688" Received: from moutng.kundenserver.de ([212.227.17.8]) by mail4-smtp-sop.national.inria.fr with ESMTP; 13 Mar 2012 23:46:42 +0100 Received: from office1.lan.sumadev.de (dslb-094-219-210-049.pools.arcor-ip.net [94.219.210.49]) by mrelayeu.kundenserver.de (node=mrbap4) with ESMTP (Nemesis) id 0M2u5m-1SNK9m2DJ8-00schP; Tue, 13 Mar 2012 23:46:40 +0100 Received: from gps.dynxs.de (localhost [127.0.0.1]) by office1.lan.sumadev.de (Postfix) with ESMTP id CDC76C00CB; Tue, 13 Mar 2012 23:46:39 +0100 (CET) Received: from 178.4.234.241 (SquirrelMail authenticated user gerd) by gps.dynxs.de with HTTP; Tue, 13 Mar 2012 23:46:40 +0100 Message-ID: In-Reply-To: <20120313220202.GA29196@kiuru> References: <20120313220202.GA29196@kiuru> Date: Tue, 13 Mar 2012 23:46:40 +0100 From: "Gerd Stolpmann" To: "Matti Jokinen" Cc: "Raphael Proust" , "SerP" , "caml-list" User-Agent: SquirrelMail/1.4.21 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 X-Priority: 3 (Normal) Importance: Normal X-Provags-ID: V02:K0:BHbnpAcyoNcTgWULw+/9afs8KU7MyhDvZo29tiwKcCY kpYUQkv+lS2k3Hf221nBEa47mVpe5eFxTuiQkmRTYwcccwtKmD YERLCUm49G4XVzvkONELu9ZYb3WBgeHXqeiQS3Aut8niEVO0TV 37Uh2goiphikORNqJN31txK6PG+1T2nGGZeHFvps+ITOzbS/hJ wlWfmj8dkxizSjiRTWBvFG24C+KZBkLkdDfoKbqUl4JV5nHE1O ZYEuC8sDrn6Md+ZO3CKVHFogtZTCu/dwCvj8hUOlgHlKQwCT52 BU6PWdEo5HORh2a9EqgH3WRhV97oQg992g5tK5vsc2Lh0V8E6V vTviKlqVEjM5s1LBud6NqHAWB08h89693wMQO6Mi7M8l5/XCym UplnA+EjVjBgL6DS4f7HSxX0x5QpbdF8Sk= Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id q2DMklpc008249 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: I've observed the same problem with code generated by the Hydro RPC library (using standard ocamlopt). This library can generate a very long set of mutually recursive functions, and the time spent by ocamlopt seemed to explode (compilation took minutes). ocamlc was not affected. The fix was to change the code generator, and to break the recursion into smaller pieces. > 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. This was also my observation. > 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. I guess the only difference is the length of the code passed at once to the backend, since you can generate code showing this problem for standard ocamlopt, as in my Hydro case. Gerd > > - Matti Jokinen > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa-roc.inria.fr/wws/info/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > > > -- Gerd Stolpmann, Darmstadt, Germany gerd@gerd-stolpmann.de Creator of GODI and camlcity.org. Contact details: http://www.camlcity.org/contact.html Company homepage: http://www.gerd-stolpmann.de *** Searching for new projects! Need consulting for system *** programming in Ocaml? Gerd Stolpmann can help you.