Request for review: Grepview plugin rewrite

Andreas Pakulat apaku at gmx.de
Sat Aug 28 12:32:09 UTC 2010


On 28.08.10 13:13:03, Syron wrote:
> > That only works if pcre has been built with utf8 support as far as I
> > could see. What happens if its built without utf8 support? IMHO we
> > should use QRegExp unless you can prove in that plugin that searching
> > with QRegExp is much slower than PCRE on a codebase like kdevplatform.
> > With not too-simple regexps. Also note that conversion between some
> > char* and QString (in particular when also converting encoding) is also
> > costly..
> 
> utf8: If pcrecpp has not been compiled with utf8 support, the flag is
> simply ignored and a simple ascii search is performed.
> Performance: I did some perfomance test with 38k files. QRegExp and
> pcre have nearly the same speed, but as soon as the regexp gets
> complicated, pcre is much faster than QRegExp.
> For fun I tested all combinations of QFile/std::ifstream and
> QRegExp/pcre, and the fastest is the QFile/pcre combination, even with
> conversions.
> When I searched for "void\s*[a-zA-Z_]+\s*(::\s*[a-zaA-Z_]+\s*)?\(.\)",
> QRegExp needed 31s, while pcre needed 26s. When searching for
> "\belse\b", QRegExp needed 3m5s, pcre needed 3m21s.

That only shows that there's no significant difference between QRegExp
and pcre. a 16second difference in 220 seconds is not that much. Neither
is the 5 second difference in 31 total.

> And well, about the encoding: KDevelop aims at developing, so I don't
> think that there is much use of encodings, due to the fact that most
> programs are written in English and the compilers only accept
> identifiers with standard ascii encoding.

Thats actually wrong. At lesat Java allows to use various unicode ranges
in identifiers and I bet you can find more languages. Also KDevelop is
not the only user of KDevPlatform, there's at least quanta too which
often has lots and lots of human-readable text to grep through.

Andreas

-- 
You will be recognized and honored as a community leader.




More information about the KDevelop-devel mailing list