Kodi Community Forum

Full Version: Is a diffuse effect "heavy" on the CPU / GPU? + General tips to making lighter skin
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi everyone,

I am currently making a very lightweight skin, mainly designed for low power devices (raspberry pi etc.) - Do any of you know if using a diffuse effect on a texture (to give images rounded corners etc.), is considered a "heavy" job in terms of CPU / GPU for Kodi - or shouldn't i worry about this?

Any other hints in terms of making a lightweight skin is very appreciated!

Thanks, and Merry Christmas Wink
If you want a lightweight skin then you definitely avoid using diffuses.

As for tips -

http://kodi.wiki/index.php?title=Texture_Attributes

Note: I'm not sure if the same now applies to XBTs.
Andersfisker,

Has been discussed a number of times before, try this link https://forum.kodi.tv/showthread.php?tid=236545 . But biggest slowdown has always been I/O. Keep all of your graphic files small if you can and let the Gpu scale at a almost zero cost.

Wyrm (AppTV)
see: 1390823 (post)

btw all posts made by jmarshall in that thread are worth reading if you're interested in skin optimizations
FYI:

I faced a lot of speed penalties in LE yesterday (with my Embuary skin) and I was able to reproduce on my office PC (Windows + Intel iGPU). 
My skin has a lot of visible ListItem labels at the same time. I've noticed that removing them will increase the performance up to 50%. And one main GPU eater is the defined <shadowcolor> of the labels. Without a shadow color I get up to 10 (idle) better and up to 10-20 minium fps while scrolling.

I use a lot of diffuse and colordiffuse in my skin and none of it causes the same slowdown as the labels/shadowcolor.

My desktop machine (8700k + nvidia 1080 GTX) has no problems. Just the iGPU of my office laptop and my HTPC i3 Skylake NUC.

Edit:
Disabling the dirty regions rendering with <algorithmdirtyregions>0</algorithmdirtyregions> also helps in my case. Much less stuttering but the amount of ListItem labels still causeing a frame drop of 5-10fps while idling. But <shadowcolor> isn't as much as expensive anymore.
(2018-02-27, 11:03)sualfred Wrote: [ -> ]FYI:

I faced a lot of speed penalties in LE yesterday (with my Embuary skin) and I was able to reproduce on my office PC (Windows + Intel iGPU). 
My skin has a lot of visible ListItem labels at the same time. I've noticed that removing them will increase the performance up to 50%. And one main GPU eater is the defined <shadowcolor> of the labels. Without a shadow color I get up to 10 (idle) better and up to 10-20 minium fps while scrolling.

I use a lot of diffuse and colordiffuse in my skin and none of it causes the same slowdown as the labels/shadowcolor.

My desktop machine (8700k + nvidia 1080 GTX) has no problems. Just the iGPU of my office laptop and my HTPC i3 Skylake NUC.

Edit:
Disabling the dirty regions rendering with <algorithmdirtyregions>0</algorithmdirtyregions> also helps in my case. Much less stuttering but the amount of ListItem labels still causeing a frame drop of 5-10fps while idling. But <shadowcolor> isn't as much as expensive anymore.
Thanks for heads up. Will test performance improvements on rpi3 Smile
I used diffuses for rounded corners pretty much everywhere in Arctic:Zephyr and it's probably one of the fastest skins out there. There is a slight cost, but not that much. Focus more on reducing the number of textures, texture resolution, number of controls, amount of animations, complexity of animations, and number of visibility conditions. Anything that auto-scrolls makes the screen re-draw and will cost CPU. Try to avoid String or Integer checks (e.g. String.Contains or Integer.IsGreater) where possible if another boolean can be used instead - e.g. ListItem.IsParentFolder is probably going to be faster than String.Contains(ListItem.Label,..) because the former is just a true/false flag, whilst the latter has to constantly check the string to see if it contains the label.

The big thing I've noticed is that visible conditions are quite costly, so you want to reduce them as much as you can through a combination of variables and conditional includes.
Don't use multiple label/image controls with visible conditions if a variable will work instead.
If a control (or group of controls) is only visible in certain windows, use a conditional include instead of a visible condition.

Try to minimise the total number of viewtypes available because each additional viewtype is another chunk of code which is loaded into memory and having its visible condition checked every frame. The resource cost really starts adding up surprisingly quickly. If a particular viewtype is only used in MyVideoNav, then make sure you aren't also including it in MyMusicNav. I just did a clean-up of viewtypes in Aura, and moving each view into its own individual include made a massive difference in resource cost (previously I had all the views in one big include).
(2017-12-25, 00:49)ronie Wrote: [ -> ]see: 1390823 (post)

btw all posts made by jmarshall in that thread are worth reading if you're interested in skin optimizations
 BTW, what is why the legend @jmarshall departed, association with K/X or?...
he got interested in other projects.
https://github.com/jmarshall