Merge lp://staging/~fboucault/music-app/startup_time into lp://staging/music-app

Proposed by Florian Boucault
Status: Merged
Approved by: Andrew Hayzen
Approved revision: 1020
Merged at revision: 1019
Proposed branch: lp://staging/~fboucault/music-app/startup_time
Merge into: lp://staging/music-app
Diff against target: 481 lines (+81/-76)
17 files modified
app/components/CoverGrid.qml (+5/-1)
app/components/Delegates/MusicListItem.qml (+1/-1)
app/components/ListItemReorderComponent.qml (+1/-0)
app/components/MusicToolbar.qml (+2/-0)
app/components/NowPlayingToolbar.qml (+5/-0)
app/components/Walkthrough/Slide1.qml (+1/-0)
app/components/Walkthrough/Slide2.qml (+1/-0)
app/components/Walkthrough/Slide3.qml (+1/-0)
app/components/Walkthrough/Walkthrough.qml (+2/-0)
app/music-app.qml (+51/-22)
app/ui/Albums.qml (+0/-10)
app/ui/Artists.qml (+0/-10)
app/ui/Genres.qml (+0/-10)
app/ui/LibraryEmptyState.qml (+3/-0)
app/ui/Playlists.qml (+0/-10)
app/ui/Recent.qml (+0/-10)
tests/autopilot/music_app/__init__.py (+8/-2)
To merge this branch: bzr merge lp://staging/~fboucault/music-app/startup_time
Reviewer Review Type Date Requested Status
Jenkins Bot continuous-integration Approve
Andrew Hayzen Approve
Review via email: mp+301057@code.staging.launchpad.net

Commit message

Improve startup time (by around 900ms on BQ E4.5):
- load Icons asynchronously.
- load Images asynchronously.
- load Tabs on demand.

Description of the change

Improve startup time (by around 900ms on BQ E4.5):
- load Icons asynchronously.
- load Images asynchronously.
- load Tabs on demand.

To post a comment you must log in.
Revision history for this message
Andrew Hayzen (ahayzen) wrote :

Thank you for looking into this :-)

FYI, we had a branch to do the tabs on demand and async before, but decided against it as it caused a flicker in the GridView and the thumbnailer needed to reload all the cover art (eg going from Artists->Albums->Artists). I wonder if we can make it smoother by fading the items or something? But even then, before, we preferred smoothness of changing tabs over loading performance in that case.

I'll see if I can find the branch, because what we also tried was loading the selected tab in async, and then once that has loaded, load the other tabs in the background async and then not unloading them so that there is no flicker.

Also, we know that the localstorage solution for restoring the queue on startup is slow, I'm currently resolving this upstream by fixing the load and save methods of the new Playlist component within qtubuntu-media and qtmultimedia. So don't worry about trying to speed up that part if you find it is slow :-)

Furthermore, I've found if you go Artists->Albums->Artists and scroll, you seem to have a double GridView in the Artists tab for some reason - I don't remember seeing this before.

Revision history for this message
Andrew Hayzen (ahayzen) wrote :

This is the super old branch from before [0], you can see the discussions we had. The preferred solution in that was to load the selected tab and then the others in async, but not unload. As the flicker was a large distraction to the user, note that the branch was on a much older codebase (before moving to GridView etc).

0 - https://code.launchpad.net/~ahayzen/music-app/refactor-async-loader-pages/+merge/248477

Revision history for this message
Andrew Hayzen (ahayzen) wrote :

I think the way to progress forwards with this branch is to land the async changes to images and icons. But the loading tabs on demand should be put in a separate branch and changed to load the current tab and then load the others in the background, but with no unloading.

Then when we go through our redesign, which currently changes to the way tabs are used and changes the existing tabs to head sections, we can load (and unload) the head sections on demand - as then the whole of the header won't flicker while loading.

1015. By Florian Boucault

Merged from trunk

1016. By Florian Boucault

Fixed double loading of artists page

1017. By Florian Boucault

Reduce flicker by loading tabs synchronously

1018. By Florian Boucault

Use image scaling adequately for music-app-cover.png

1019. By Florian Boucault

Nicer tabs transition by fading in art

Revision history for this message
Andrew Hayzen (ahayzen) wrote :

This is now looking visually much better and the code looks good as well. I just need to run autopilot on device and then it should be good to go :-) Thanks!

Revision history for this message
Andrew Hayzen (ahayzen) wrote :

Running this against autopilot on my device I get many failures related to any test that change the tab, this is one of the failures [1].

It appears that it is failing because it tried to check self.autoClose [2] *after* clicking the action, which then fails because the tab has changed and the one autopilot is looking at has been unloaded.

Either, we need to write our own helper, or we could capture StateNotFoundError errors in our switch_to_tab_wrapper() and assume that the next part of the text will fail/check we are in the right place. (Which most do as in the get_songs_page() case it then tried to get the Page, so it would fail then).

So probably the best solution for now is putting a try catch in the switch_to_tab_wrapper() [3].

1 - http://pastebin.ubuntu.com/23374367/
2 - http://bazaar.launchpad.net/~ubuntu-sdk-team/ubuntu-ui-toolkit/trunk/view/head:/tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/popups.py#L108
3 - http://bazaar.launchpad.net/~fboucault/music-app/startup_time/view/head:/tests/autopilot/music_app/__init__.py#L483

review: Needs Fixing
1020. By Florian Boucault

Fixed autopilot failures due to disappearing popovers

Revision history for this message
Andrew Hayzen (ahayzen) wrote :

Thanks for fixing those issues. LGTM, all tests 'pass' (I seem to be a getting one random failure due to the mediascanner mocking failing [also occurs on trunk so my device might just be racey]).

Sorry this took a long time to land.

review: Approve
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches