[mythtv] extremly slow mythfilldatabase in 0.28

Jonatan Lindblad mythtv at comhem.se
Sun Oct 15 10:19:59 UTC 2017


Den 2017-10-15 kl. 11:16, skrev Torbjorn Jansson:
> On 2016-07-22 14:15, Torbjorn Jansson wrote:
>> On 2016-07-18 09:10, Karl Dietz wrote:
>>> On 17.07.2016 23:11, Jonatan Lindblad wrote:
>>>> Den 2016-07-17 kl. 19:08, skrev Torbjorn Jansson:
>>>>> On 2016-07-17 13:57, Roger Siddons wrote:
>>>>
>>>> <snip>
>>>>
>>>>>> The metagrabber shouldn't be run at all by MFD (AFAIK). Add the "-v
>>>>>> system" log option to confirm it isn't being invoked.
>>>>>
>>>>> looks like it is doing just that.
>>>>
>>>> The invocation of ttvdb.py seems to come from
>>>> https://code.mythtv.org/trac/browser/mythtv/mythtv/programs/mythfilldatabase/xmltvparser.cpp#L530.
>>>>
>>>>
>>>>
>>>> I'm not sure this was taken into account in b64be0f8, but calling the
>>>> script(s) for potentially every program seems a bit unnecessary. Unclear
>>>> if this is the cause for long runtime though.
>>>
>>> When I wrote that test there was no intention to call the grabber for
>>> each and every programme.
>>> My hacking time is limited at the moment, so feel free to adjust it to
>>> store the configuration variables in global variable or similar.
>>> An easy first optimization might be to split the condition into two, to
>>> avoid the expensive test (that presumably calls the grabber now) if the
>>> attribute does not match the expected string.
>>>
>>> https://github.com/MythTV/mythtv/blob/master/mythtv/programs/mythfilldatabase/xmltvparser.cpp#L519-L539
>>>
>>>
>>
>> attached is a patch that attempts to fix this.
>> it is lightly tested and seems to do what i wanted.
>> calls to the grabber scripts is significantly reduced (but not eliminated) and mfdb now runs much quicker.
>>
>> the patch is not the most elegant one especially with how i had to "solve" the MetadataDownload Get Movie and tvgrabber calls.
>> it was not possible to but those two lines in the constructor or a segfault would occur, most likely other parts needs to be initialized properly first, like the connection to the database.
>>
>> anyway, "works for me"
>>
>>
> 
> it is getting time to upgrade my system, any idea if this bug was ever fixed in 0.28 or 0.29 ?

Yes!  Your patch was committed and is included in 29, https://github.com/MythTV/mythtv/commit/cc5c3e04ecb7df651619061c59dbc240578fa797.

Jonatan


More information about the mythtv-dev mailing list