You could try compiling a native OCaml compiler executable with profiling option (-p) (setting that up might be a pain, though).

Before that you could try to only typecheck the file (option "-i") to know whether it's the type-checking or code generation that is problematic. (-i causes type printing as well, so for very large types that are internally shared it can be its own source of slowness)

If it was in code generation, that would most likely only occur during when compiling to native code. Have you noticed the performance bottleneck with compilation to bytecode as well?

(Of course using the natively-compiled versions of your compilers will also speed up performance, but if your generated code hits one of the source of exponential behavior of the compiler you're out of luck anyway.)

On Sun, Aug 26, 2012 at 4:20 PM, Hongbo Zhang <bobzhang1988@gmail.com> wrote:
Hi List,
   I have a file which is only 410 lines, the compilation process takes nearly 1 minutes. Before my refactoring, it's compiled very fast.
   Is there a way to know which part the compiler spend most time in ?
   Many Thanks

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