Re: Performance implications of GRegex structure



[Owen, I apologize, I hit Reply instead of Reply All]

Owen Taylor wrote:
So, the regular expression code has been committed to CVS finally. Yay!

But looking over the header file, there is something that puzzles me
about the way that it's set up: there is no distinction between a
"pattern/regular expression" object and a match/matcher object.
...
Or to Javascript, Perl, etc. (Javascript and Perl hide the issue a bit
by having regular expression literals.) While I have never actually done
timings on the matter, I've always assumed that the reason that regular
expression API's are set up this way is compiling a regular expression
has a significant expense.

EggRegex contains two structures internally - Pattern and Match.
egg_regex_copy() references Pattern and creates new Match structure.
If you got a copy of EggRegex object using egg_regex_copy(), you
can use it in another thread. Don't know how convenient it is in
multi-thread setup. The idea was that it's inconvenient to create
some match objects on heap.

Best regards,
Yevgen




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