[Qt-interest] QRegExp compilation
Eric Clark
eclark at ara.com
Wed Jan 13 19:33:47 CET 2010
Thank you Rob! I figured the Qt guys would have taken this into account because they are usually pretty good about this kind of optimization, but just wanted to be sure.
Eric
> -----Original Message-----
> From: Bachrach, Robert L [mailto:rob.bachrach at tycoelectronics.com]
> Sent: Wednesday, January 13, 2010 12:20 PM
> To: Qt Interest (qt-interest at trolltech.com)
> Cc: Eric Clark
> Subject: RE: QRegExp compilation
>
> Eric clark wrote:
> > Someone recently posted some optimization help with regular
> > expressions and strings and they mentioned that it is better to not
> > have to recreate regular expressions if you use the same one numerous
> > times because compilation is time consuming. I was wondering if the
> > QRegExp class recompiles the regular expression when it is copied
> from
> > one to the other? Or if the compilation is copied with the QRegExp?
>
> I checked the QRegExp source code. It appears the assignment operator
> (and, consequently, the copy constructor) attempt to share the regular
> expression state engine. So, it appears that it does carry the
> "compilation" with the copy.
>
> Rob
More information about the Qt-interest-old
mailing list