Slow Python scripts in Krypton

It looks like is not working for me…
During the day I have to stop kodi, cause otherwise is killing my pi.
After stating again the CPU is back to normal until I use some addon or and running one does something in background…
@kreuss is this update fixing your pi too?

As there are no other reports of this, it is likely caused by an add-on rather than OSMC or the Kodi core.

I would you suggest you disable all add-ons and re-enable them one at a time until you find the one which is “killing your pi”.

I doub an addon is the issue, cause my kodi is quite fresh.
After krypton update in February I removed my .kodi folder and started from scratch.
I can do this again of course, but I don’t see how the slow python issue could be caused by an addon.
See my post from February:

I also try to fix my issues following some indications from the kodi forum.
http://forum.kodi.tv/showthread.php?tid=304613

pip uninstall pyopenssl
pip uninstall cryptography

sudo apt-get install python-cryptography
sudo apt-get install python-openssl

Now if I check this two packages and compare the versions I get the following:
Affected Rpi:

osmc@osmc:~$ sudo apt show python-cryptography
Package: python-cryptography
Version: 1.3.4-1~bpo8+2
Installed-Size: 1027 kB
Maintainer: Tristan Seligmann <mithrandi@debian.org>
osmc@osmc:~$ sudo apt show python-openssl
Package: python-openssl
Source: pyopenssl
Version: 16.0.0-1~bpo8+1
Installed-Size: 185 kB
Maintainer: Sandro Tosi <morph@debian.org>

New Rpi:

osmc@osmc-Ian:~$ sudo apt show python-cryptography
Package: python-cryptography
Version: 0.6.1-1
Installed-Size: 968 kB
Maintainer: Tristan Seligmann <mithrandi@debian.org>
osmc@osmc-Ian:~$ sudo apt show python-openssl
Package: python-openssl
Source: pyopenssl
Version: 0.14-1
Installed-Size: 377 kB
Maintainer: Sandro Tosi <morph@debian.org>

I think the issue is fixed by downgrading the two packages:

sudo apt-get install python-cryptography=0.6.1-1
sudo apt-get install python-openssl=0.14-1

At least at first glance it look like, youtube addon seams to work and CPU load in the first mins is normal :smiley:
I’ll give some feedback if I still have issues…

After the April update my osmc installation is slower than ever. Not sure about the exact cause, but it definitely started with Krypton.
Am mainly using the iVysílání addon. Processing the “podle data” menu option increased to about five minutes with Krypton. Since the April update it’s now closer to seven minutes. Before Krypton it was about 2 minutes.

For me python scripts are very slow, too.

I also noticed some strange behaviour, which can be reduced to such minimum working example:

    while not xbmc.abortRequested:
         xbmc.log("[test] > sleep", level=xbmc.LOGNOTICE) 
         time.sleep(0.5)
         xbmc.log("[test] > sleep end", level=xbmc.LOGNOTICE)

It produces this log:
14:58:33.742 T:1672737776 NOTICE: [test] > sleep
14:58:35.812 T:1672737776 NOTICE: [test] > sleep end

Between both log messages are around 2.1 seconds - I would expect sth around 0.5s.

Downgrading the two packages mentioned above in my post, worked for me.
But I had to update temporary to get certbot installed, since then I cannot downgrade then any longer, i get this:

osmc@osmc:~$ sudo apt-get install -t python-cryptography=0.6.1-1
Reading package lists... Done
E: The value 'python-cryptography=0.6.1-1' is invalid for APT::Default-Release as such a release is not available in the sources
osmc@osmc:~$ sudo apt-get install python-openssl=0.14-1
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-openssl is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 29 not upgraded.

Any ideas ?

The first one is using -t which should be followed by a target repo.

Probably what you want is

sudo apt-get install --reinstall python-cryptography=0.6.1-1

Ditto:

sudo apt-get install --reinstall python-openssl=0.14-1

The version numbers you are specifying are the latest versions, so using --reinstall without the version number should install the latest version by default.

Without -t I get the same result…sorry for misleading parameter
What worked for me was to remove the packages completely.
But this is just a workaround, this issue is present for very long time and as we can see I’m not the only one affected.
I’m wandering why a newer version of the two packages is causing this python to be very slow in Kodi…

Not solved in the May 2017 update.

You writed about this in Kodi forum or GitHub (as issue)?

No, I wrote it here. I don’t think it’s a Kodi issue.

Really? Why not?

Since the May or the June update it’s back to five minutes. Still. 5 minutes.

Well, with your concrete data I think that they can check differences between Kodi 16 and 17.
You tested other so like Libreelec to discard is this is osmc problem or Kodi?

Are there recent logs in this thread?
Is there an addon we can test with on Jarvis and Krypton to compare?

Sam

He said:

"Am mainly using the iVysílání addon. Processing the “podle data" menu option increased to about five minutes with Krypton. Since the April update it’s now closer to seven minutes. Before Krypton it was about 2 minutes.”

I don’t know what is this addon (but apperas in some github results, googling), I only copied.

The benchmark went up to 5min 15sec after the July update.
The addon was installed from the CZ SK repository: KODI CZ/SK - repozitář doplňků (click on Stáhnout to download).

Once again: Is there a common add-on in the Kodi repository we can both test against as a benchmark?