[mythtv] Reducing frontend startup time

Lawrence Rust lvr at softsystem.co.uk
Fri Jan 8 20:06:01 UTC 2016


On Fri, 2016-01-08 at 20:31 +0100, warpme wrote:
> > Wiadomość napisana przez Lawrence Rust <lvr at softsystem.co.uk> w dniu 08.01.2016, o godz. 20:10:
> > 
> > On Fri, 2016-01-08 at 13:57 -0500, Dan Wilga wrote:
> >> On 1/8/16 1:54 PM, Lawrence Rust wrote:
> >>> Hi all,
> >>> 
> >>> I've put together 5 patches on the devel/lvr/startup branch which
> >>> together considerably reduce the startup time on remote frontends.  The
> >>> saving is especially significant on my Raspberry Pi's where the time is
> >>> reduced from around 15 seconds down to 5.
> >>> 
> >>> The changes mainly introduce static caches around MySQL select
> >>> operations that retrieve static settings.  I've also included a patch to
> >>> UPnP startup to make the UPnP announcement run in it's own thread and so
> >>> not delay the main thread - this saves a second or so.
> >>> 
> >>> I've been using these patches on my own systems for a couple of years
> >>> now.  But before I pushed I wanted to give everyone a chance to comment
> >>> on them as they have a significant impact on the database.
> >> Hi Lawrence,
> >> 
> >> You've made so many (wonderful!) changes in that branch that it can be 
> >> difficult to find just these few changes. Could you please post some links?
> > 
> > Sure,
> > 
> > DB: Load all dbase settings into cache at startup
> > https://github.com/MythTV/mythtv/commit/37c2c3ce047a442930830060daf8e1faee1a7152 <https://github.com/MythTV/mythtv/commit/37c2c3ce047a442930830060daf8e1faee1a7152>
> > 
> > DB: Update settings cache in SaveSettingOnHost
> > https://github.com/MythTV/mythtv/commit/8d987c9d5baf15cbdd4de18dea7272e8cadc6cd2 <https://github.com/MythTV/mythtv/commit/8d987c9d5baf15cbdd4de18dea7272e8cadc6cd2>
> > 
> > SimpleDBStorage: Where possible use Get/SetSetting to speed frontend
> > https://github.com/MythTV/mythtv/commit/2181ecca4f35ba0dd39182802e74a3a1c6bcb076 <https://github.com/MythTV/mythtv/commit/2181ecca4f35ba0dd39182802e74a3a1c6bcb076>
> > 
> > UI: Provide dbase cache for RegisterKey and RegisterJump to speed sta
> > https://github.com/MythTV/mythtv/commit/bea896e448e7a7fd6c6f2b2d46e11f636fe034a3 <https://github.com/MythTV/mythtv/commit/bea896e448e7a7fd6c6f2b2d46e11f636fe034a3>
> > 
> > UPnP: Reduce startup latency by moving blocking code to own thread
> > https://github.com/MythTV/mythtv/commit/f2226b56c1c03ab76d90b9b081b2c1eb526e71f5 <https://github.com/MythTV/mythtv/commit/f2226b56c1c03ab76d90b9b081b2c1eb526e71f5>
> > 
> > -- 
> > Lawrence Rust
> > 
> > _______________________________________________
> > mythtv-dev mailing list
> > mythtv-dev at mythtv.org <mailto:mythtv-dev at mythtv.org>
> > http://lists.mythtv.org/mailman/listinfo/mythtv-dev <http://lists.mythtv.org/mailman/listinfo/mythtv-dev>
> > http://wiki.mythtv.org/Mailing_List_etiquette <http://wiki.mythtv.org/Mailing_List_etiquette>
> > MythTV Forums: https://forum.mythtv.org <https://forum.mythtv.org/>
> Lawrence,
> I’m using first 4 patches in MiniMyth2 since months with v.good results.
> On ION1, FE startup time is reduced from 12-13sec to 7-8sec.
> No single stability issue noticed.
> IMHO patches are good candidates to be included into official code.
>  
> I think current FE has also another area of additional start speed-up: Bonjur startup.
> Currently it is in main thread and takes some sec. on startup.
> 
> BTW: In my case Bonjur code also has bug: if there is enabled AirPlay video - there is race in concurrent starting audio and video Bonjur services leading to FE crash. 
> In Minimyth2 crash is average per 10-15 starts.

I must hold my hands up and admit that I don't have the Bonjour
headers/libs installed.  I've never needed it so I've never tried.  I
must get around to installing the dev package and give it a try.

In all honesty I don't see why, with a bit of effort, we can't get the
time until Myth displays some kind of UI down to just a second or so.
It doesn't inspire confidence in an app when it takes an age to show
just a basic UI.  Even on a combined FE/BE there is a significant pause
after starting any Myth program.

Many thanks for your feedback and encouragement.

-- 
Lawrence Rust



More information about the mythtv-dev mailing list