On 8/26/12 11:05 AM, Gabriel Scherer wrote: Hi Gabriel, Sorry for the noise, it turns out that I upgraded my ocalmfind, and forget to modify findlib.conf. ocamlfind still picks 'ocamlc' instead of 'ocamlc.opt'. There's a huge performance difference(10x) between ocamlc.opt and ocamlc. Thanks! > 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 > 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 > >