Opened 14 years ago

Closed 14 years ago

#762 closed patch (fixed)

progdetails menu is slow to load

Reported by: mythtv@… Owned by: paulh
Priority: minor Milestone: unknown
Component: mythtv Version:
Severity: medium Keywords:
Cc: Ticket locked: no

Description

The progdetails menu is slow to load. This appears to be a result of computing the background image of m_richtext four(!) times.

This patch gets rid of two of these. Firstly, UIRichTextType is changed to decouple loading the background image (loadBackgroundImg) and computing m_compBackground (updateBackground()). A sizable fraction of the time was spent in scaling the loaded image, so this decoupling greatly decreases the cost of SetBackground?(). As a result, many of the recomputations of m_compBackground are avoided as well, since that is not necessary if no new background image was loaded. Secondly, ProgDetails::setDetails() calls m_richtext->SetBackground?(&mybackground). This was already run in the constructor and does not appear to need to be re-called.

This patch decreased the load time of progdetails on my system (Athlon XP 3000) from 1.05 seconds to 0.35 seconds.

Attachments (1)

progdetails-speed.patch (4.2 KB) - added by mythtv@… 14 years ago.
proposed patch

Download all attachments as: .zip

Change History (4)

Changed 14 years ago by mythtv@…

Attachment: progdetails-speed.patch added

proposed patch

comment:1 Changed 14 years ago by Adam Egger

It took 8 seconds on my AMD64-3000+ system after pressing U. The old one was *much* faster. I'm very happy I'm not the only one with this speed problem. I'll give it a try when I'm at home, thanks!

comment:2 Changed 14 years ago by paulh

Owner: changed from Isaac Richards to paulh
Status: newassigned

Thanks for this. I'll take a look.

comment:3 Changed 14 years ago by paulh

Resolution: fixed
Status: assignedclosed

(In [8146]) Apply the patch by mythtv (at) hburch.com

Optimises UIRichTextType's computing of its background image.

In addition to the changes outlined in the ticket it also changes the size of pd-background.png to the correct dimensions for the default 800x600 screen size so we can use gContext->LoadScaleImage?() to load the pre-scaled image.

Closes #762

Note: See TracTickets for help on using tickets.