switching views is excruciately slow

Milian Wolff mail at milianw.de
Wed Apr 6 15:21:38 UTC 2011


On 04/06/11 09:31, Manuel Massing wrote:
> Hi,
>
> I am working on a medium-size codebase (about 300.000 loc), and
> unfortunately the switch between "Debug" and "Code" views
> is really slow with such a project - it takes about 20-30 seconds,
> during which the UI completely freezes!

how many files do you have open? or does this not matter? BTW I noticed 
the same delay, very interesting that you found an apparent reason for that.

> This makes the debug mode nearly unusable. Of note here is that
> almost all of this time is spent installing event filters. My
> dirty work-around was to comment the following lines out, without
> apparent ill effects:
 >
> --- a/sublime/mainwindow_p.cpp
> +++ b/sublime/mainwindow_p.cpp
> @@ -253,8 +253,8 @@ Area::WalkerMode
> MainWindowPrivate::ViewCreator::operator() (AreaIndex *index)
>               if (widget&&  !container->hasWidget(widget))
>               {
>                   widget->installEventFilter(d);
> -                foreach (QWidget* w, widget->findChildren<QWidget*>())
> -                    w->installEventFilter(d);
>                   container->addWidget(view, position);
>                   d->viewContainers[view] = container;
>                   d->widgetToView[widget] = view;

please put the patch on reviewboard.

> Can someone with knowledege of the code explain the purpose of these event
> filters? Do you see a way to fix this, e.g. make it into an "opt-in scheme"?

I'll have to investigate that once I have time. Though could you check 
d->eventFilter() overload? What does it do - if anything? And is 
installing the event filter slow or finding the children? Do you have a 
callgrind file I can look at?

Bye, and thanks for bringing this to our attention
-- 
Milian Wolff
http://milianw.de




More information about the KDevelop-devel mailing list