caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Brighten Godfrey <pbg@cs.berkeley.edu>
To: caml-list@yquem.inria.fr
Subject: Strange performance bug
Date: Tue, 28 Apr 2009 19:43:08 -0700	[thread overview]
Message-ID: <324B24CA-9671-42C0-B722-C7710C0C45C7@cs.berkeley.edu> (raw)

Hi,

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?

Here's the story.  I'm parsing a file (using the PCRE library in one  
step).  It goes quickly.  When I parse the same file a second time, it  
goes an order of magnitude more slowly.  Using Str instead of PCRE  
fixes the problem, but I'm not ready to blame PCRE, because various  
other minor changes make the problem disappear too.  I have tried to  
strip this program down to the smallest possible, but it appears to be  
sensitive to the details of the code in ways that I wouldn't expect,  
so I couldn't make it as small as I'd like.

Entire package to reproduce the problem (unpack, make, then run "./ 
problem fast" or "./problem slow"):

	http://www.cs.berkeley.edu/~pbg/tmp/ocaml_performance_problem.tar.bz2

Just the code:

	http://www.cs.berkeley.edu/~pbg/tmp/problem.ml


In case it matters, I am running OCaml 3.11.0 on Mac OS X 10.5.6 on  
Intel.  The problem seems to happen with both ocamlc and ocamlopt.

Can anyone else reproduce this problem or figure out what is going  
on?  Am I doing something silly?

Thanks so much,
~Brighten


             reply	other threads:[~2009-04-29  2:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-29  2:43 Brighten Godfrey [this message]
2009-04-29  3:37 ` [Caml-list] " Markus Mottl
2009-04-29  4:31   ` Brighten Godfrey
2009-04-29  6:18     ` Alain Frisch
2009-04-29  6:27       ` Brighten Godfrey
2009-04-29  6:37         ` Alain Frisch
2009-04-29  8:29           ` Brighten Godfrey
2009-04-29 13:58             ` Markus Mottl
2009-04-29 14:48               ` Damien Doligez
2009-04-29 16:03                 ` Markus Mottl
2009-04-29 19:19                   ` Brighten Godfrey
2009-04-29 19:38                     ` Markus Mottl
2009-04-29 20:23                       ` Brighten Godfrey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=324B24CA-9671-42C0-B722-C7710C0C45C7@cs.berkeley.edu \
    --to=pbg@cs.berkeley.edu \
    --cc=caml-list@yquem.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).