classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Classpath regexp code


From: Ziga Mahkovec
Subject: Re: Classpath regexp code
Date: Wed, 01 Jun 2005 15:11:17 +0200

On Tue, 2005-05-31 at 19:34 -0600, Tom Tromey wrote:
> >> I sent some email to the JRegex guy to ask how he felt about
> >> incorporating it into Classpath.
> 
> I haven't had a response.
> 
> Ziga> Since I recently wrote some Mauve tests[1] for java.util.regex, I
> Ziga> decided to run them against jregex.  It failed on 15/360 tests (results
> Ziga> attached).

I'm adding embedded flags (?idmsux-idmsux:X) to the list of features
jregex doesn't support; I'll be sending a patch for gnu.regexp soon.

> Ziga> The testlets aren't meant as a benchmark, but jregex did finish much
> Ziga> faster: 0.484s vs. 3.931s for gnu.regex (both running jamvm).
> 
> I think we should consider using jregex even without an assignment.
> Unless somebody wants to drastically speed up gnu regex, that is.

Well, I started looking into these performance problems, but I'm not
sure yet if there's any low hanging fruit here.

Anthony already showed that lots of time is spent running clone() and
garbage collection.  The culprit here is
gnu.regexp.RETokenRepeated.match(), which is used for matching a*, a?, a
+ and a{n,m} tokens.  In the worst case, it clones two
gnu.regexp.REMatch instances for *each* token of the input string.
REMatch contains two integer arrays (also cloned) and other fields as
well, so this is a killer for performance.

I'll be able to spend more time on this the coming weekend.
-- 
Ziga





reply via email to

[Prev in Thread] Current Thread [Next in Thread]