From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id AAA28421; Thu, 15 May 2003 00:13:51 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id AAA28231 for ; Thu, 15 May 2003 00:13:50 +0200 (MET DST) Received: from mail.exomi.com (mail.exomi.com [217.169.64.72]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h4EMDnH01455 for ; Thu, 15 May 2003 00:13:49 +0200 (MET DST) Received: from exomi.com (unknown [10.0.5.5]) by mail.exomi.com (Postfix) with ESMTP id F407C5DE2; Thu, 15 May 2003 01:13:48 +0300 (EEST) Date: Thu, 15 May 2003 01:13:48 +0300 Subject: Re: [Caml-list] Performance problem Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v552) Cc: caml-list@pauillac.inria.fr To: Matt Gushee From: Ville-Pertti Keinonen In-Reply-To: <20030514210332.GA27927@swordfish> Message-Id: <55DB7CE4-8659-11D7-9845-000393863F70@exomi.com> Content-Transfer-Encoding: 7bit X-Mailer: Apple Mail (2.552) X-Spam: no; 0.00; caml-list:01 bug:01 buffering:01 terrible:01 slower:01 non-trivial:01 match:02 ambiguous:02 str:05 output:05 guess:06 obvious:06 maybe:06 depends:07 problem:07 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > these figures seem way beyond the pale. There must be a bug either in > my > code or one of the supporting libraries. The only obvious possibilities > that occur to me are an output buffering problem or some delay in > interacting with the X display, but I'm not sure how to solve either of > those. And maybe it's something else entirely. Can anyone explain my > terrible results? My guess (without profiling) is that most of the time is being spent doing regular expression matching. Regular expressions can be much slower than you might expect for non-trivial cases. The expression in your program looks particularly nasty, since there are a lot of ambiguous cases (whether '-' should match '.*' or '-' depends on everything that follows). You might want to try using Str.split instead. ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners