Re: Performance implications of GRegex structure



On Thu, 2007-03-15 at 10:56 -0400, Owen Taylor wrote:

> Well, I could imagine (maybe, barely) that someone could show me numbers
> that showed that with a variety of long and complicated regular
> expressions, compiling them was still 10x as fast as matching them
> against very short strings.
> 
> But in general, yes, part of my concern is that there are situations
> where you are going to matching the same regular expression against
> thousands of strings, and in that situation, unless compilation is very,
> very, fast, the need to repeatedly recompile will inevitably produce
> measurable overhead.

If this were to happen, could you not just put together a per-thread
5-entry double hash table to cache the 5 most recently used regex
strings ? It really seems like a no-brainer. Am I missing something ?

Mathieu
-- 




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