UI lags when scrolling through scopes

Bug #1395994 reported by Marcus Tomlinson
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
unity8 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Some causes ruled out:

1. OA in scopes can't be to blame as I have tested with and without it enabled, and with and without it present in the code (https://bugs.launchpad.net/ubuntu/+source/unity-scopes-api/+bug/1392615/comments/4).

2. Location can't be blamed either (for the same reasons as above, as well as removing location service usage from the shell plugin itself).

3. When profiling the QML and C++ code, I saw no indication that the shell plugin was doing anything process intensive enough to cause any hold up. In fact, it seems to be doing a pretty good job handling calls from the UI thread asynchronously.

Observations made when profiling unity8:

1. The QML ListView component updates its current item index when the next item reaches half-way across the screen (therefore, in mid animation between scopes). There doesn't look to be any serious blocking actions taking place during the onIsCurrentChange, setActive, etc. methods that I could find, but we should keep this in mind.

2. ResultsModel::data() seems to be called constantly while scrolling a scope up and down. I assume this should only be called once per result item (This doesn't explain the horizontal scrolling lag, but it may explain some vertical lag).

3. If you pull down to refresh any scope, then continuously move the dash left and right, the dash movement is smooth until results start showing up in the scope, at which point you see a lag as they appear. The lag observed here is almost definitely the same lag we see when scrolling through scopes (jittering as results start to pop up in scopes as they populate).

(NOTE: All of the above points were observed with and without the latest unity8 performance fixes in rtm silo 8)

summary: - UI lags when scrolling through favorited scopes
+ UI lags when scrolling through scopes
Revision history for this message
Michał Sawicz (saviq) wrote : Re: [Bug 1395994] [NEW] UI lags when scrolling through favorited scopes

> 2. ResultsModel::data() seems to be called constantly while scrolling a
> scope up and down. I assume this should only be called once per result
> item (This doesn't explain the horizontal scrolling lag, but it may
> explain some vertical lag).

That's not exactly right. It will be called for every role*every result
that a delegate is created for. Delegates are recycled and created as
they go out and into view, respectively.

*If* it's called on the same result and same role multiple times, while
the result is constantly in view, that'd be a problem indeed.

Revision history for this message
Albert Astals Cid (aacid) wrote :

I'm going to have a look at the ResultsModel::data claim now, seems something we should fix if it's indeed happening.

Revision history for this message
Albert Astals Cid (aacid) wrote :

As Michał says we call ::data for each delegate and for each role, I could not reproduce it being called "continously"

Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

Its quite easy to reproduce:

Stick a "qDebug("DATA() CALLED");" into ResultsModel::data(), and keep scrolling one scope up and down. Those message don't seem to stop for me.

Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

SORRY!! I overlooked the "result is constantly in view" predicate.

However, why recycle them out of view?

Revision history for this message
Michał Sawicz (saviq) wrote : Re: [Bug 1395994] Re: UI lags when scrolling through scopes

> SORRY!! I overlooked the "result is constantly in view" predicate.
>
> However, why recycle them out of view?

Saving memory, imagine having 10000 results above what you're looking at.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in unity8 (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.