twinther/script.tvguide

Start-up incredibly slow on Raspberry Pi

Opened this issue · 4 comments

It takes a very long time to load the guide on a Raspberry Pi after a while of not using it. Usually it takes more then a minute, which almost nullifies the practical use of the guide as a quick switch to it too see what's on.

It's not really possible to make out what step of the loading takes so long because text gets replaced by the time estimation. I've been going through the code a little bit but I can't see any obvious bottle-necks as fast as I would like to. It does appear that the code is processing all the programs instead of only the ones of the enabled channels. Changing it to exclude the disabled channel programs would at least decrease the loading time to some extend but I can't tell if it would be enough. It would, however, need to trigger a re-process when one or more channels are enabled again.

I'm using a local copy of http://www.click2record.nl/xmltv/xmltv.xml

The XMLTV file is reloaded once every 24 hours to get any new information.
This is probably what happens when you see the long loading times.
Combined with the raspberry pi's low-spec cpu it will take some time. Your file loads in about 5-10 seconds on my i5 cpu.
Br.
Tommy

No, it happens more often within the 24 hours. I should mention that I re-download the file every 6 hours. Does a newly downloaded, but possibly identical file, mean it will perform the same import again?

Even though the RPi doesn't have as much CPU power, I feel that it should be plenty to process the file quicker. Compared to your findings it does sound about right though.

Ah okay. Whenever the file modification time is altered the addon will reload the XMLTV file again.

Perhaps you should add the option to pull X amount of days out of the xml file to speed up the EPG load process and continues to load the rest in the background as long as the app is open. I launched this thing last night for the first time and it took about 30 minutes on my Amazon Fire TV. It said 1080 seconds. I also launched it on my PC and it loaded in 120 seconds - so it said. I didn't actually timed it.