Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenELEC Python slow performance #2483

Closed
Black09 opened this issue Jul 19, 2013 · 29 comments
Closed

OpenELEC Python slow performance #2483

Black09 opened this issue Jul 19, 2013 · 29 comments

Comments

@Black09
Copy link

Black09 commented Jul 19, 2013

Hi,

I noticed this on some add-ons for several month now... while TV Show Next Aired opens instantly on my OS X development machine (XBMC 12.2, Core i7 2600k), it takes about 2 seconds on my OpenELEC machine (3.1.3, Core i3 3225). The same happened yesterday on an updated version of pieh's RSS-Client. While switching between channels was almost instantly on OS X, it took several seconds on OpenELEC.

I then did some tests to find the problem and so far I've narrowed it down to the listItem.setProperty('key', 'value') function. While creating a new listitem and setting a test property with a string with length of ~1000 the execution was about a thousand times slower on OpenELEC than on OS X. What I've noticed though is that it sometimes seems to be as fast as it should be while sometimes its really slow. You can see some results below where you can see that it constantly changes from being slow and fast (I measured multiple times in a loop).

time: 0:00:00.016583
time: 0:00:00.016560
time: 0:00:00.016562
time: 0:00:00.016542
time: 0:00:00.000017
time: 0:00:00.016483
time: 0:00:00.000018
time: 0:00:00.000025
time: 0:00:00.000018
time: 0:00:00.016486
time: 0:00:00.016572
time: 0:00:00.016575
time: 0:00:00.016573
time: 0:00:00.000021

In case you're asking: Speedstep is disabled, the cpu runs always on the same speed (3,3GHz). Also it seems to be only this operation so far but there might be more.

Maybe someone has a clue why this happens and can fix it, thanks in advance.

@vpeter4
Copy link
Contributor

vpeter4 commented Jul 22, 2013

Can you provide some small test so it can be compared on other machines?

@Black09
Copy link
Author

Black09 commented Jul 22, 2013

Install http://cl.ly/2D3Y1H3a3u1y and run from the programs section.

Some results from me:

OS X:
avg time: 0.000022s
total time: 0.228883s

OpenELEC 3.1.3:
avg time: 0.001990s
total time: 19.901708s

@stefansaraev
Copy link
Contributor

EDIT: sry. ignore this comment.. :)

@vpeter4
Copy link
Contributor

vpeter4 commented Jul 22, 2013

My time was consistent every time:

average time: 0:00:00.000037
total time: 0:00:00.378

I think this means 0.3 sec for 10000 properties? Which is ok?

@Black09
Copy link
Author

Black09 commented Jul 22, 2013

Yes that's normal... did you test with OE 3.1.X? If so than there must be a problem with my configuration but I have no idea what that could be.

@vpeter4
Copy link
Contributor

vpeter4 commented Jul 22, 2013

ION x86_64 devel-20130719203949-r15107

What top shows when running this script?

@stefansaraev
Copy link
Contributor

Generic.x86_64
OpenELEC git: f838ee9

results:
average: 0:00:00:000048
total: 0:00:00:487133
~ 100 runs, same result.

@Black09
Copy link
Author

Black09 commented Jul 22, 2013

Alright thanks for the tests. I did a quick test with a fresh userdata folder it seems to be fixed now. I'll try to find the problem which caused this to be so slow.

@Black09
Copy link
Author

Black09 commented Jul 22, 2013

Could you please test what happens if you run the script from the home screen? Currently if I run it from programs with a fresh userdata folder, everything is fine but if I run it from the home screen, it lasts 30 seconds.. however if I go into programs after a few seconds, the script is immediately done. Very strange...

@stefansaraev
Copy link
Contributor

@Black09 home screen you mean settings -> appearance -> skin (confluence) -> settings -> addons -> home page program submenu ?
if so - same results as above

@Black09
Copy link
Author

Black09 commented Jul 22, 2013

Ok than I have to live with it for now (very annoying...) because I can't figure it out. I renamed the .xbmc folder and started completely fresh but the script lasts 20-30s from the home screen and is fast from the program section. With all my configured stuff it's slow all the time... it almost seems as the script runs with very very low priority.

@Black09
Copy link
Author

Black09 commented Jul 24, 2013

I think I've figured out the problem... it seems it has something to do with multi-core. If I enable both cores in the bios, the script runs 20-30s off the home screen and if I enable just one core, it's not as fast but acceptable.

All cores + HT enabled:
Programs: 0,05-0,1s
Home: 20-30s

Just 1 Core enabled, HT off (it must be off, otherwise -> slow):
Programs: 0,1s
Home: 0,5s

I then tested my configured setup (the tests above were done with a fresh livestick) with 1 core + HT disabled and everything is fast, no more lags with TV Show Next Aired etc... Maybe someone knows how to fix this issue. I'm running a Core i3-3225 with the ASRock H77M-ITX.

@stefansaraev
Copy link
Contributor

enable all cores. disable ht. ht is a myth. closing this as not openelec related.

@vpeter4
Copy link
Contributor

vpeter4 commented Jul 24, 2013

I wonder what results are with all cores but disabled ht. I would say bad as with ht.

@stefansaraev
Copy link
Contributor

offtopic. I had very similar issue on few servers runing a "heavy" java application. supermicro boards. disabled ht (kept all cores active) - cpu usage went down from 100 to 5%. IMO HT does more harm than good on multicore..

@Black09
Copy link
Author

Black09 commented Jul 24, 2013

I tested all cores with HT disabled, doesn't work. It's working fine (fast) with 1 core only. I have HT enabled on OS X and it's working just fine in XBMC so HT is NOT the problem.

@vpeter4
Copy link
Contributor

vpeter4 commented Jul 24, 2013

Maybe it have something with dirty regions and refreshing main screen.

@Black09
Copy link
Author

Black09 commented Jul 24, 2013

I've disabled dirty regions.

@stefansaraev
Copy link
Contributor

can you please do: dmesg | pastebinit

@Black09
Copy link
Author

Black09 commented Jul 24, 2013

http://sprunge.us/ALJe

@stefansaraev
Copy link
Contributor

now enable all cores + ht and do it again

@Black09
Copy link
Author

Black09 commented Jul 24, 2013

http://sprunge.us/ZKUN

@stefansaraev
Copy link
Contributor

cat /proc/cpuinfo | pastebinit

@Black09
Copy link
Author

Black09 commented Jul 24, 2013

http://sprunge.us/ZULZ

@stefansaraev
Copy link
Contributor

thanks. seems fine to me. can you do the same test with ubuntu + xbmc ?

@Black09
Copy link
Author

Black09 commented Jul 24, 2013

I'm on it. :)

@Black09
Copy link
Author

Black09 commented Jul 24, 2013

Same problems with XBMCbuntu 12.2.

@stefansaraev
Copy link
Contributor

so it must be either a xbmc / python bug or broken / buggy BIOS.

@Black09
Copy link
Author

Black09 commented Jul 24, 2013

I don't think it's a bios problem. Problem with linux / xbmc / python and my hardware combination seems more likely to me.

Edit:
Posted this also on the xbmc forums -> http://forum.xbmc.org/showthread.php?tid=169730
I also did a test with OpenELEC on my other PC with a Core i7 2600k and the problem doesn't occur there.

shaun2029 pushed a commit to shaun2029/LibreELEC-HotPi that referenced this issue Apr 7, 2018
LibreELEC Repo bumps: service.libreelec.settings and brcmfmac_sdio-firmware-rpi [Backport]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants