Kodi Community Forum

Full Version: Would switching to conditional includes improve efficiency?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
If I switched from visibility conditions to conditional includes wherever possible, would it improve efficiency or performance? I'm not particularly up on how XBMC handles controls, but would this give it fewer controls to worry about at any one time?
Apparently conditional includes only get read on window create
So if a certain window - MyVideoNav, let's say - features both TV and Movie controls that display according to conditional visibility, would there be any benefit in splitting those using conditional includes? So when you load the Movie library rather than TV, you save on the TV-related resources?
I doubt it because the window doesn't get reloaded when switching between the 2 unless you access it directly

But to be honest I'm vague on the whole conditional includes thing I didn't even know they existed until last month
Maybe jm can shed some light on it. I'm even more in the dark than you are, obviously, though I understand Aeon does have a rather extreme number of controls on the go at once.
Conditional includes only get included when the window is loaded, yes. So if you include only controls you need then obviously that reduces the number that XBMC has to iterate through.

If the user cannot get to their movies while in tvshows, then that'll work just fine. If they can, then strange things may happen (basically your nice movie views won't be available, unless the window is reloaded first).

Note that another problem is that the include conditions must be able to be evaluated at window load - i.e. some conditions may not be correctly returned if the rest of the window environment (such as which dir they're in, what the content type is and so on) has yet to be setup. I'm not sure exactly when some of these are valid, so it's something to be careful about.

Certainly skin options will be set at that point (and won't change while you're in that screen, one presumes) so they can be used to switch stuff off.

Cheers,
Jonathan
jmarshall Wrote:If the user cannot get to their movies while in tvshows, then that'll work just fine. If they can, then strange things may happen (basically your nice movie views won't be available, unless the window is reloaded first).

Which explains the problem when using remotes to jump straight from Movies to TV Shows bypassing the Home menu.
That problem actually grew from a much earlier use of skin settings to differentiate the two libraries, which itself stemmed from trouble I was having controlling the uppermost windows - the genre, title, etc. ones. They didn't seem to fit in with the whole Container.Content system. I was probably missing something, though.

Anyway, the conditional includes thing has compounded the issue past the point of being rectified now, which is absolutely fine by me as I don't see the whole remote-jumping thing as essential. In fact, I'd be surprised if more than 1 per cent of XBMC users used it. If I could, I'd shut that functionality out of Aeon entirely to stop people running into problems.
djh_ Wrote:They didn't seem to fit in with the whole Container.Content system.

They do now! kinda anyway, you can read all about it here:

trac

I never actually got round to trying it out myself though.
jmarshall Wrote:some conditions may not be correctly returned if the rest of the window environment (such as which dir they're in, what the content type is and so on) has yet to be setup. I'm not sure exactly when some of these are valid, so it's something to be careful about.

Cheers,
Jonathan
Sorry to be a thread necromancer but is there a way, other than trial and error, to find what is valid at window load? Is there a section of source code I could browse through to find out?
wannabegt4 Wrote:Sorry to be a thread necromancer but is there a way, other than trial and error, to find what is valid at window load? Is there a section of source code I could browse through to find out?

SkinHasSetting and WindowIsActive should be safe to use.