Bug 376198 - Slow start of kaffeine
Summary: Slow start of kaffeine
Status: RESOLVED FIXED
Alias: None
Product: kaffeine
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Mauro Carvalho Chehab
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-08 18:56 UTC by yulinux
Modified: 2017-02-16 17:20 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
start with --debug of the repository version (2.0.5) (3.21 KB, text/plain)
2017-02-16 13:36 UTC, yulinux
Details
start with --debug before applying the change (8.18 KB, text/plain)
2017-02-16 13:37 UTC, yulinux
Details
start with --debug after the patch (newest git from today) (9.23 KB, text/plain)
2017-02-16 13:38 UTC, yulinux
Details

Note You need to log in before you can comment on or make changes to this bug.
Description yulinux 2017-02-08 18:56:05 UTC
Hello,
kaffeine (compiled from the actual git) starts very slow on my computer, it takes around 12 seconds, although it has 4 cores á 2.6 GHz and 4 GB RAM. As it starts immediately if I create a new profile, and as there are many messages about the EPG if I start it with the debug parameter, I suspect that the EPG somehow slows it down. I remember a bug report where it was written that the EPG code could be optimized more in order to speed up. Can't find it, though.
Anyway this is meant just as a reminder, and only for the "wish-list". Thanks. :)
Comment 1 Mauro Carvalho Chehab 2017-02-15 11:52:22 UTC
(In reply to yulinux from comment #0)
> Hello,
> kaffeine (compiled from the actual git) starts very slow on my computer, it
> takes around 12 seconds, although it has 4 cores á 2.6 GHz and 4 GB RAM. As
> it starts immediately if I create a new profile, and as there are many
> messages about the EPG if I start it with the debug parameter, I suspect
> that the EPG somehow slows it down. I remember a bug report where it was
> written that the EPG code could be optimized more in order to speed up.
> Can't find it, though.
> Anyway this is meant just as a reminder, and only for the "wish-list".
> Thanks. :)

Kaffeine should not be reading EPG messages when it starts, except if a record is scheduled to happen at the moment Kaffeine starts). On such case, it will need to open the DVB device, with could take some time, specially if the device requires to load a firmware (on some legacy devices, firmware load can take up to 30 seconds).

If this is not the case, please attach the messages with debug enabled.
Comment 2 yulinux 2017-02-16 13:36:32 UTC
Created attachment 104054 [details]
start with --debug of the repository version (2.0.5)
Comment 3 yulinux 2017-02-16 13:37:24 UTC
Created attachment 104055 [details]
start with --debug before applying the change
Comment 4 yulinux 2017-02-16 13:38:17 UTC
Created attachment 104056 [details]
start with --debug after the patch (newest git from today)
Comment 5 yulinux 2017-02-16 13:40:42 UTC
With the latest changes from today (probably "dvbepg: optimize EPG duplicated entry handling" ?) it starts much faster:

$ date && ./kaffeine
Do 16. Feb 14:01:14 CET 2017
16-02-17 14:01:15.139 [Info    ] Using built-in dvb device manager
16-02-17 14:01:15.825 [Info    ] Found dvb device : Realtek RTL2832 (DVB-T)
16-02-17 14:01:16.499 [Info    ] Found dvb device : Panasonic MN88473

2 seconds for the total start is okay.

Without this change it was more than twice as long:
$ date && ./kaffeine
Do 16. Feb 13:55:14 CET 2017
16-02-17 13:55:17.792 [Info    ] Using built-in dvb device manager
16-02-17 13:55:18.480 [Info    ] Found dvb device : Realtek RTL2832 (DVB-T)
16-02-17 13:55:19.147 [Info    ] Found dvb device : Panasonic MN88473

I do no know why it is now not 12 seconds as described above any more, but that was the value measured last time. I also changed my DVBT device and there are some changes to the channels etc.


With --debug it takes longer, as it prints so much out. More complete versions are attached.

One point is that kaffeine is reading EPG messages, although there are not scheduled recordings. But this is not a problem any more, as it is pretty fast now, just wanted to tell you. Anyway, for me this can bug report can be closed now.

But as visible in the attachments, there is nice progress: before there was like at least 4 seconds EPG stuff, now it's around 1 second.
Comment 6 Mauro Carvalho Chehab 2017-02-16 17:20:56 UTC
(In reply to yulinux from comment #5)
> With the latest changes from today (probably "dvbepg: optimize EPG
> duplicated entry handling" ?) it starts much faster:
> 
> $ date && ./kaffeine
> Do 16. Feb 14:01:14 CET 2017
> 16-02-17 14:01:15.139 [Info    ] Using built-in dvb device manager
> 16-02-17 14:01:15.825 [Info    ] Found dvb device : Realtek RTL2832 (DVB-T)
> 16-02-17 14:01:16.499 [Info    ] Found dvb device : Panasonic MN88473
> 
> 2 seconds for the total start is okay.
> 
> Without this change it was more than twice as long:
> $ date && ./kaffeine
> Do 16. Feb 13:55:14 CET 2017
> 16-02-17 13:55:17.792 [Info    ] Using built-in dvb device manager
> 16-02-17 13:55:18.480 [Info    ] Found dvb device : Realtek RTL2832 (DVB-T)
> 16-02-17 13:55:19.147 [Info    ] Found dvb device : Panasonic MN88473
> 
> I do no know why it is now not 12 seconds as described above any more, but
> that was the value measured last time. I also changed my DVBT device and
> there are some changes to the channels etc.
> 
> 
> With --debug it takes longer, as it prints so much out. More complete
> versions are attached.
> 
> One point is that kaffeine is reading EPG messages, although there are not
> scheduled recordings.

Hmm... it will actually read the EPG messages usually stored at:
    ~/.local/share/kaffeine/epgdata.dvb

That should be quicker, although, if I remember the code, it will pass though the logic that detects duplicated events too, and discarding too old entries.

 That can
actually explain the start delay you had in the past version.

> But this is not a problem any more, as it is pretty
> fast now, just wanted to tell you. Anyway, for me this can bug report can be
> closed now.
> 
> But as visible in the attachments, there is nice progress: before there was
> like at least 4 seconds EPG stuff, now it's around 1 second.

Good news! I'll close this bug as FIXED. Please re-open if you still find something weird there.