(2015-08-26, 15:14)denywinarto Wrote: [ -> ]PHP Code:
<include file="file name.xml">includename</include>
I see, but what if the include is called multiple times such as animations includes?
Can we use it too?
The real question is if you are only using the animation once why are you bothering with a include.
If you are using something as small as an animation block only once just inline the code as it would be quicker to load than using
a include. In fact, unless it would help with readability or making things easier to edit I would not bother with a include for anything
a small as a animation block (easy to edit is the main reason I have a few animations in includes).
Quote:I think my delay is related to dynamic content mechanism,
I'm calling 12 items x ~30 different playlists in home menu (Ace) using dynamic content..
it's quite alot because i also include genres selection..
there's 1-3 second delay when loading the items
I'm concerned because i'm only using a smaller sample library that i made in my local PC to test my custom skin..
My real library is like 40TB with hundreds of tvshows and thousands of movies..
I have removed all unnecessary windows and xml..
I'm surprised it only takes 1-3 seconds before you see something,
you are making things way harder than they need to be. Let's see if we can catch all of the problems with your posted code.
Quote:I think there are the related codes, to call the first playlist
IncludeMenuplaylist.xml
Code:
[php]<include name="mf_contentvpl1">
<control type="group">
<posx>0</posx>
<posy>60</posy>
<control type="panel" id="510">
<!--- Recent Video -->
<include>panel_video_v</include>
<include>panel_videolayout</include>
<visible>Container(9000).HasFocus(31) + SubString(skin.string(mfvpl1_list),latest)</visible>
<content target="video" limit="12">$VAR[DefWidgetContent]</content>
</control>
<control type="panel" id="510">
<!--- Recomemended Video -->
<include>panel_video_v</include>
<include>panel_videolayout</include>
<visible>Container(9000).HasFocus(31) + SubString(skin.string(mfvpl1_list),random)</visible>
<content target="video" limit="12">$VAR[DefWidgetContent2]</content>
</control>
</control>
</include>
IncludeVIPMenu.xml
Code:
<item id="31">
<!-- Vpl 1 -->
<label fallback="31072">$INFO[skin.string(vpl1.label)]</label>
<label2>West Movie</label2>
<icon fallback="special://skin/backgrounds/vplaylist.jpg">$VAR[value_mainmenubg_vpl1]</icon>
<onclick>Skin.SetBool(playlists)</onclick>
<onclick>Skin.SetString(playlist,v1)</onclick>
<onclick condition="Container(9000).HasFocus(31) + SubString(skin.string(mfvpl1_list),latest)">ActivateWindow(videolibrary,$INFO[skin.string(vpl1.path)],return)</onclick>
<onclick condition="Container(9000).HasFocus(31) + SubString(skin.string(mfvpl1_list),random)">ActivateWindow(videolibrary,$INFO[skin.string(vpl1a.path)],return)</onclick>
<property name="dropdown">not_empty</property>
<property name="widget">Playlist</property>
<property name="widget2">Playlist2</property>
<property name="widgetPlaylist">C:/Users/Downloader/AppData/Roaming/Kodi/userdata/playlists/video/Barat.xsp</property>
<property name="widgetPlaylist2">C:/Users/Downloader/AppData/Roaming/Kodi/userdata/playlists/video/Recommended_Barat.xsp</property>
<visible>!IsEmpty(skin.string(vpl1))</visible>
</item>
IncludeVariables.xml
Code:
<variable name="DefWidgetContent2">
<!-- Individual Widget Paths -->
<value condition="StringCompare(Container(9000).ListItem.Property(widget2),Playlist2)">$INFO[Container(9000).ListItem.Property(widgetPlaylist2)]</value>
</variable>
<variable name="Widget_Title">
<value condition="!IsEmpty(Container(510).ListItem.Title)">$INFO[Container(510).ListItem.Title]</value>
</variable>
<variable name="Widget_Subtitle">
<value condition="!IsEmpty(Container(510).ListItem.TagLine)">$INFO[Container(510).ListItem.TagLine]</value>
</variable>
<variable name="Widget_Fanart">
<value condition="!IsEmpty(Container(510).ListItem.Art(fanart))">$INFO[Container(510).ListItem.Art(fanart)]</value>
</variable>
<variable name="Widget_Plot">
<value condition="!IsEmpty(Container(510).ListItem.Plot)">$INFO[Container(510).ListItem.Plot]</value>
</variable>
<variable name="Widget_TVShowTitle">
<value condition="!IsEmpty(Container(510).ListItem.TVShowTitle)">$INFO[Container(510).ListItem.TVShowTitle]</value>
</variable>
<variable name="Widget_Genre">
<value condition="!IsEmpty(Container(510).ListItem.Genre)">$INFO[Container(510).ListItem.Genre]</value>
</variable>
<variable name="Widget_Rating">
<value condition="!IsEmpty(Container(510).ListItem.Rating)">$INFO[Container(510).ListItem.Rating]</value>
</variable>
Is there anything else that could be optimized in terms of coding?
My sample library doesn't even have 1% content of the real library.. and it still lags 1-3 secs..
I haven't removed the unnecessary textures though..
Biggest issue is that ALL of you variable definitions have only one item. Just replace the $INFO from your value statements above
and don't bother with the condition as if the $INFO is empty the value with be empty anyway. So instead of code like this
PHP Code:
<control type="panel" id="510">
<!--- Recent Video -->
<include>panel_video_v</include>
<include>panel_videolayout</include>
<visible>Container(9000).HasFocus(31) + SubString(skin.string(mfvpl1_list),latest)</visible>
<content target="video" limit="12">$VAR[DefWidgetContent]</content>
</control>
Just use this and do away with the DefWidgetContent variable as its pointless.
PHP Code:
<control type="panel" id="510">
<!--- Recent Video -->
<include>panel_video_v</include>
<include>panel_videolayout</include>
<visible>Container(9000).HasFocus(31) + SubString(skin.string(mfvpl1_list),latest)</visible>
<content target="video" limit="12">$INFO[Container(9000).ListItem.Property(widgetPlaylist2)]</content>
</control>
Next avoid substring compares like the plague as they are verrrrrrrryyyyyyy slow. So if you have only two options that you want to check
use a boolean instead. Instead of using.
PHP Code:
<property name="dropdown">not_empty</property>
I would use something like
PHP Code:
Skin.SetBool(v1_list_dropdown)
And set it to true if you want a dropdown to be available.
Now while it will not save a great deal of time as I'm pretty sure visible conditions are cached
(the result of a condition are only checked once and the result is reused each time you use it), Kodi will still have to parse each
instruction in the xml file to display your screen. So don't keep checking for the same condition if your code is nested in a block
where you have already checked something. For example.
PHP Code:
<include name="mf_contentvpl1">
<control type="group">
<posx>0</posx>
<posy>60</posy>
<control type="panel" id="510">
<!--- Recent Video -->
<include>panel_video_v</include>
<include>panel_videolayout</include>
<visible>Container(9000).HasFocus(31) + SubString(skin.string(mfvpl1_list),latest)</visible>
<content target="video" limit="12">$VAR[DefWidgetContent]</content>
</control>
<control type="panel" id="510">
<!--- Recomemended Video -->
<include>panel_video_v</include>
<include>panel_videolayout</include>
<visible>Container(9000).HasFocus(31) + SubString(skin.string(mfvpl1_list),random)</visible>
<content target="video" limit="12">$VAR[DefWidgetContent2]</content>
</control>
</control>
</include>
Change this to.
PHP Code:
<include name="mf_contentvpl1">
<control type="group">
<posx>0</posx>
<posy>60</posy>
<visible>Container(9000).HasFocus(31)</visible>
<control type="panel" id="510">
<!--- Recent Video -->
<include>panel_video_v</include>
<include>panel_videolayout</include>
<visible>SubString(skin.string(mfvpl1_list),latest)</visible>
<content target="video" limit="12">$VAR[DefWidgetContent]</content>
</control>
<control type="panel" id="510">
<!--- Recomemended Video -->
<include>panel_video_v</include>
<include>panel_videolayout</include>
<visible>SubString(skin.string(mfvpl1_list),random)</visible>
<content target="video" limit="12">$VAR[DefWidgetContent2]</content>
</control>
</control>
</include>
And remove the occurrence of "Container(9000).HasFocus(31)" in the panels and items as you have already checked that condition
and you don't really need to check again.
Now will the above suggestions reduce the time to display your panel any great amount? Don't know, as Kodi needs time to populate the
results of the playlist. If you can use an internal content listing (think of items that you would see in the root of the video library as examples)
that Kodi stores in its database that will certainly be quicker than if you use a custom playlist that needs to be pulled into the system. The things is
currently you are doing a lot of unnecessary checks and executing code that basically does nothing, so the the suggestions above can't hurt.
Quote:BTW speaking of texture..
i think i remember reading somebody said using texture cache utility could also speed things up..
Let me see if i can find it again..
Would probably help a bit and certainly can't hurt.
Make the changes I suggested above and see how you go. I have probably missed a number of things that might speed things up but until you cut back
on the worthless code its a bit hard to see what else needs fixing
Wyrm (AppTV)