Opened 20 years ago
Closed 20 years ago
#762 closed patch (fixed)
progdetails menu is slow to load
| Reported by: | 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)
Change History (4)
by , 20 years ago
| Attachment: | progdetails-speed.patch added |
|---|
comment:1 by , 20 years ago
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 by , 20 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
Thanks for this. I'll take a look.
comment:3 by , 20 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
(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

proposed patch