jellycon
jellycon copied to clipboard
Showing all movies is very slow
Describe the bug When accessing All Movies via JellyCon, it can take up to half a minute until the content is displayed on screen. I assume that it is simply fetching all movies via api, and performance may differ depending on library size (mine is roughly 2000 movies). It also loads the same amount of time when returning to this screen after playback stops. The power of the device running Kodi is a factor but my main 12c workstation also takes about 10-15s to load, and on lower-end ATV devices the load time is pretty painful.
To Reproduce
- Connect to a server with a sizeable movie library
- Display All Movies
- Wait...
Expected behavior Some kind of lazy load so the user won't have to wait for all movies to be fetched. Not sure if this is possible within the Kodi framework, but anyway.
Logs Using Kodi on android so not entirely sure how to get them. Let me know if they are necessary and I'll see what I can do
System (please complete the following information):
- OS: Android TV
- Jellyfin Version: 10.7.6
- Kodi Version: 19.1
- Addon Version: 0.4.4
This is unfortunately more or less expected. Loading more than a few hundred movies at once is always going to be slow, both from a waiting for the server to respond and trying to process all that data locally. And loading it into Kodi is basically all or nothing. There's no way to do any lazy loading that I'm aware of. I'm sure there's more optimizations in the network code that I can do, but once you get a library of any respectable size we start getting limited by the server. For example, just making an api call to my server with ~1000 movies takes almost 10 seconds, without any of the Kodi specific processing in place.
Especially for larger libraries like this, it's probably better to use some of the lower categories, specifically the Movies - Pages
or Movies - A-Z
will likely give you the best results.
Just thinking out loud here, but maybe adding a caching feature that runs in the background would help usability when using JellyCon with large libraries like this? In options you would enable/disable, set the interval and choose which libraries you want cached to disk, Kodi then reads this instead of fetching live data every time. Again, don't know how doable it is within Kodi as I've never written any code for it myself (though I'm thinking about it)
A-Z is definitely a workaround I'll try out. I'm not setting this up for myself though so we'll see if it's deemed acceptable
There is a cache feature already, but it only comes into play once a given option has been loaded once. ie: the next time you try to open Movies - Show All
it should only take <2 seconds to load. The cache also doesn't persist through restarts. There's a background task that will cache images, but I haven't dug into how the caching of actual content works.
The alternative of course is using Jellyfin for Kodi instead. It synced metadata from Jellyfin into Kodi's local database. However, it has it's own quirks like being unable to easily switch users and not coexisting well with other media sources.
I can't seem to get that cache to activate (or the device is just too slow to make any major difference), It seems to take roughly 10-15s regardless. It's just the way it is I guess, unless you want to consider this a feature request instead.
Yeah that's what I'm using personally. What I wanted to avoid is the constant syncing it does as it can be quite lengthy sometimes
A lot of this is going to be based on local device speed. On my desktop, loading 1000 movies takes roughly 1 second.
It will also be better in the next release. From my testing on loading that same 1000 movies on a Pi3: Previous release: ~17.5 seconds Current master: ~11 seconds
There's probably a few more optimizations that can be made, but I'm getting diminishing returns at this point so I'm not sure how much farther I'll be able to take it.
Same here, on a distant jellyfin server (over WAN) I have an almost systematic 15s wait for each request, as if it was timing out on something. jellycon looks nice and thanks for sharing it with the community!
What device are you using? Being remote will obviously introduce some extra delay based on network speed, but device speed still seems to be the most important metric from my testing.
Also, the next release should see a significant speed increase if you're using Kodi 19 thanks to #183 (brings the test in my previous comment from 11 seconds to 5 seconds).
The device is a "4CPU Intel(R) Atom(TM) CPU 330 @ 1.60GHz, 4G or RAM, SSD". Looking forward to the next release (and yet I'm using Kodi 19). Glad to hear these issues are being looked at.
Version 0.5.3 was just released, which should be faster. I'd be interested in hearing what the performance differences are on your device, as obviously I only have limited hardware I can test on myself. Namely, a fourth gen i5 and Pi3.
Sorry for the late report, haven't been using Kodi in a while. Just tried v0.6.1 and it is noticeably faster on my Shield Tube (closer to 10s instead of 20+). Sadly playback in Kodi borked for me so I can't really test much more, but it's a nice improvement!
At this point it's about as fast as I can reasonably make it without major overhauls of the code, which I don't have the time or dedication to do right now. Given that the overall speed is significantly better than it was when this issue was first opened, I'm gonna call it a success and close this issue out.