[mythtv-users] MythGallery: selecting a favorite picture as directory thumb

Paul Harrison mythtv at sky.com
Thu Nov 6 23:19:27 UTC 2014


On 06/11/14 22:11, Roger Siddons wrote:
> On Wed, 05 Nov 2014 15:49:54 -0000, Paul Harrison <mythtv at sky.com> wrote:
>
>>
>> The problem seems to be the call to GalleryViewHelper::LoadTreeData() 
>> which causes a swarm of SQL queries and Service API calls. Some 
>> directories are taking 30 seconds to load here.
>>
>
> I agree the SQL isn't optimal but it isn't significant here.
> The service API is cumbersome and causing the ~5s delay between 
> selecting a large directory & starting to display it. I've fixed that 
> - just waiting on review.
>
> The issue seems to be with the way it's using the mythuibuttonlist. 
> Something is causing it to continually redraw so all the images are 
> being repeatedly reloaded. With 30-40 images the effect is not that 
> noticeable but with lots of subfolders it gets exponentially worse. 
> When loading a screen of 112 pics I saw 70 buttonlist redraws.
>
> Initially all the remote reads repeatedly fail, but delay the BE from 
> creating the thumbs. Later on the images are repeatedly re-read from 
> the FE cache. It actually does well to do all that in 30s!
>
> I thought it might be a feature of the buttonlist but Mythmusic 
> doesn't experience it. It takes 7s to load 100 album covers (remotely) 
> with a single redraw. I'll investigate further.

In MythMusic I use the itemVisible signal from the buttonlist to only 
update those items that are visible. I tried the same trick in the new 
gallery icon view but it didn't make much difference since it's building 
the MythGenericTree that is taking all the time not the updating of the 
button items.

The attached patch shows what I mean. You may be able improve on it by 
moving more stuff into UpdateImageItem() so only visible items do the 
slow stuff like grabbing the thumbs etc?

Paul H.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: newgallery.diff
Type: text/x-patch
Size: 5005 bytes
Desc: not available
URL: <http://www.mythtv.org/pipermail/mythtv-users/attachments/20141106/0fd630b9/attachment.bin>


More information about the mythtv-users mailing list