On Tue, Apr 28, 2009 at 22:43, Brighten Godfrey <p...@cs.berkeley.edu> wrote: > I've encountered a very odd performance problem which I suspect is not a bug > in my code. Could it be the compiler, or maybe PCRE?
I'm not sure it solves your problem (haven't tried the example), but just looking at the code there is clearly a performance bug: the pattern is passed to Pcre.pmatch "on the fly" using label "~pat". This is ok and convenient if it is used only once, but is bad if it happens in a loop. Precompile the regular expression outside of the loop (let rex = Pcre.regexp "...") and pass it in with label "~rex" to solve this problem. Regards, Markus -- Markus Mottl http://www.ocaml.info markus.mo...@gmail.com _______________________________________________ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs