Re: POSIX regex performance bug in 7.3 Vs. 7.2 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: POSIX regex performance bug in 7.3 Vs. 7.2
Date
Msg-id 29872.1044320823@sss.pgh.pa.us
Whole thread Raw
In response to Re: POSIX regex performance bug in 7.3 Vs. 7.2  (wade <wade@wavefire.com>)
List pgsql-hackers
Sigh.  It seems that somebody broke caching of compiled regexes,
so that your regex is recompiled each time it's used.  I haven't
dug into the logic yet, but I think it must have been a mistake
in Thomas' change to make the regex cache be searched circularly:

2002-06-14 22:49  thomas
* src/backend/utils/adt/regexp.c: Search the existing regularexpression cache as a ring buffer.  Will optimize the case
forrepeatedcalls for the same expression,  which seems to be the mostcommon case. Formerly, always searched    from the
firstentry.  Maywant to look at the least-recently-used algorithm to make sure it is identifying the right slots to
reclaim.Seems silly to do mathwhen  it seems that we could simply use an incrementing counter...
 

Considering that we now know that this is a factor-of-150 performance
hit, I wonder if this is a "must fix" for 7.3.2?  We already wrapped
the tarball, but ...
        regards, tom lane


pgsql-hackers by date:

Previous
From: wade
Date:
Subject: Re: POSIX regex performance bug in 7.3 Vs. 7.2
Next
From: wade
Date:
Subject: Re: POSIX regex performance bug in 7.3 Vs. 7.2