OutputModel performance

Andreas Pakulat apaku at gmx.de
Wed Feb 6 13:13:09 UTC 2013


Hi,

On Wed, Feb 6, 2013 at 1:25 PM, Kevin Funk <krf at gmx.de> wrote:
> I recently noticed that I get serious UI lockups when running a 'make install'
> job inside KDevelop for larger projects such as kdelibs. 'make install' here
> may produce roughly ~4500 lines of output in just a few seconds.
>
> All these lines are parsed in the action/error filter in the output view tool.
> I suspected that using QRegExp there in the main thread is a serious
> bottleneck which I tried to evaluate using callgrind. Attached [1] is a
> callgrind run that had instrumentation enabled just before the make job was
> started.
>
> Callgrind isn't really useful to tell if this will cause UI hickups, of
> course. It just shows that there are *a lot of* calls to QRegExp::indexIn(),
> namely ~145000, for (just) 4500 lines of output.
>
> So, the question here:
> - Did anyone of you guys experience similar issues just to begin with?

I regularly experience ui-lockups that take between 500 and 3000 ms
and they tend to happen more often the longer I work with KDevelop.
However in none of these cases did I have loads of compile-output
added very quickly to the outputview.

> - Do you think it makes sense to optimize that?

Well, making the parsing of the output lines faster is definetly
worthwhile, I'm not sure wether making the regex-parsing in a thread
is the right first step though.

>   E.g. move the regexp logic out of the main thread?

I'd start with adding a delay to the batch-adding, right now the items
are added as fast as possible provided the event-loop has nothing else
to do. Adding a bit of a delay (say 250 or even 500 ms) could improve
that already quite a lot.

Andreas


More information about the KDevelop-devel mailing list