-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Building ListItem lists is very slow #604
Comments
You can compare listing "My most recent" with VRT NU v2.0.0, v2.1.1 or v2.2.3 (all sub-second) to master branch (more than 7 seconds). Listing "All programs" takes 25 seconds. |
It seems unrelated to resumepoints, even when disabled you see this effect. |
Here is a diff between v2.2.3 and the master branch: v2.2.3...master |
It is also unrelated to our change from |
I cannot find exactly why passing a kodi-instance with methods is so much faster than calling discrete functions... https://stackoverflow.com/questions/37472419/speed-static-methods-vs-class-method |
Definitely related to |
But we follow the recommendations and we no longer store values in long-lived instances. In fact we have no long-lived instances anymore in the plugin. And no global variables. If I disabled reuselanguageinvoker I still have the same performance problems. Performance problems only exists with building ListItem lists of content. The time is directly proportional to the number of items in the virtual directory when showing video content, the TV guide schedule has a listing of 37 items that is not affected (no metadata?). |
Problem was easily spotted by profiling. Every invocation of Addon() not only rereads the settings, but also reparses po language files. 😞 |
In https://github.com/pietje666/plugin.video.vrt.nu/tree/34240cdc9819818ab54836d7077805982ccefed2 I think we should return to the previous situation. You only need to call |
Successive and selective imports should not have an impact as this is cached.
Obviously this is our own xbmc stubs doing this, so I might be hunting ghosts... |
So moving Doesn't look nice (very Kodi-specific) but would be most efficient. It really sucks that there is no proper way to re-read the settings :-/ Which brings me to something I was playing with.
In this case we wouldn't need to keep the cache (Windows properties) fresh or have a ttl mechanism. We could perform actions when specific settings change (a more generic solution for the credentials changes) and this would be most efficient. It does add to the complexity of the add-on though... |
But is it slower than with KodiWrapper? |
I doubt it. I haven't profiled on Kodi itself, only tested the solution after profiling locally. |
And I guess I was lucky that my stub implementation showed a similar behaviour as xbmcaddon, because I don't think it's exactly the same issue, but a similar overhead pattern. The fix I propose does not fix it for the stubs 😄 |
Describe the bug
Compared to earlier VRT NU versions, building a ListItem list of 50 or 300 items has become unbearably slow (more than 5 seconds) on Raspberry Pi. This is with local HTTP caching, so it is not due to the network.
The performance degradation appears to happen as part of the metadata handling.
The text was updated successfully, but these errors were encountered: