code structure for best skin performance
#1
Hi guys,

Just wanted to double check. Is it best practise to keep as much code (mainly duplicate code) as possible in includes.xml (animations, etc), then refer back to it in the other xml's?

I'm geussing it is as that makes most sense, however i was worried that the includes.xml might get to bloated and affect performance.

Also, in the media folder, is it best to keep as many textures as possible directly in the root of media, or will it have a negitive performance effect if i file the textures away in sub folders?

Cheers as always. Wink
Reply
#2
While I can't speak performance wise, in regards to XBMC, personally, when I'm coding something, I always try to reuse as much as I can. I hate duplicating code line and just tends to lead to more hassles later on down the line.

I've always had the mindset of if I want to change a particular part of code that affects multiple things, I'd rather change it once than have to track down every instance of it to change it.
Reply
#3
No difference whatsoever; it just makes it easier for us to code.
Reply
#4
Cool, just checking.

Cheers Hitcher
Reply
#5
One thing to remember about includes though is the fact they are only loaded, and have any conditions checked, upon the current window opening.
Reply
#6
As Hitcher suggests, it's not all that much difference performance-wise (parsing the XML takes way longer than resolving the includes I think). IMO it's a balance:

Too much stuff in includes and it becomes unwieldy (obviously separate include files helps here). Too little and you have bloated code.

Also, too much stuff in includes and you lose the context when looking at the code (eg what does this button look like, and where is it positioned?: <control type="button"><include>foo</include></control>

A general rule is keeping positioning info in the controls themselves, sane defaults for all controls in defaults.xml, and then just put additional includes on things that are repeated more than 3 or 4 times throughout the skin - name 'em so you know what they are (and/or can find them quickly).

Just try not to refactor things too much - it's no fun jumping through 5-6 includes to try and find the piece of info you need!

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#7
Thanks for the tips guys. You're all bloody good blokes you know! Wink
Reply

Logout Mark Read Team Forum Stats Members Help
code structure for best skin performance0