> 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 -- 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