kdevelop/parts/outputviews

Andras Mantia amantia at freemail.hu
Fri Mar 28 08:48:04 UTC 2003


John Firebaugh wrote:

> Thanks Andras. I tried to cachegrind gideon to get a better idea of where
> the time was going, but cachegrind crashes (somehow caused by the parsing
> threads, I think). I am suprised that doing the regexes takes so much time
> -- wish I could get a cachegrind of that particular part.

I used the good old method of putting trace outputs and meassuring the
execution time, as for some reasons valgrind/cachegrind does not run with
my 2.4.20 + preemptive patch kernel, and I'm too lazy to boot another
kernel. But yes, regexp searches can take up very much time. Also the idea
to avoid the construction of the QRegExp inside the loop is good, but it
won't solve the whole problem. You have quite complex regexps in the
MakeActionFilter. Instead of "/bin/sh\\s.*libtool.*--mode=compile" can't
you just search for "--mode=compile" ? Also instead of searching with a
regexp containing also the file name and using cap() to retrieve the
result, it may be faster to search only for the mode (compiling /
generating / linking ) and if the regexp matches, search again the line for
the file name. This may reduce the number of regexps and the search time if
the regexp is not found. It may slightly increase the time of the search
when the first search result is true, as you need to do another search on
the line, but happens only once in the for loop, and not for every
iteration. Doing this later search backwards, starting from the end of the
line may also help.

Andras
-- 
Quanta Plus developer - http://quanta.sourceforge.net
K Desktop Environment - http://www.kde.org





More information about the KDevelop-devel mailing list