Speed question? xml vs. python
#1
I have an addon that runs a timing sensitive routine. I have 2 screens coded in xml. These screens share several common features such as progress bars.

Right now I have about 30 text fields that I reconfigure when switching from one screen configuration to the other. I do this with 30 lines of xbmcgui.window(10000).setProperty('field','value') statements in my Python code.

My question is would my code execute faster if I hard coded the different text fields in my xml code and simply toggled the visibility field of each set from my python code? Then I'd only need one or 2 lines of Python code to select between the 2 screen configurations but my xml code would be 2 x longer.

Please let me know if you think this would be better posted in the skinning section (I'm a newbee).
Reply
#2
Without code to review I can't give you specifics... In general setProperty is NOT as efficient as a static xml value... I recommend you use the below to monitor execution time.

https://docs.python.org/2/library/timeit.html
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply

Logout Mark Read Team Forum Stats Members Help
Speed question? xml vs. python0