xbmc icon indicating copy to clipboard operation
xbmc copied to clipboard

slow startup esp with lots of skin widgets due to addon menu's caching removed on startup

Open djay opened this issue 9 months ago • 7 comments

Bug report

Describe the bug

When starting kodi, any addon menus that were cached to disc (via the cacheToDisc=True param in the addon), are not used on startup. This leads to the user having to wait a long time if they have skin with many widgets which point to addon menus. This is particularly bad with a lot of widgets and on a lower end machine that can't handle so many python instances all loading at the same time (1 per widget).

It also seems like json-rpc calls used by widgets don't cache at all which is unexpected.

Expected Behavior

Kodi should startup fast with content quickly displayed in all widgets even if out of date , letting the user choose to wait for more updates or use the widgets as is.

Actual Behavior

Kodi calls all the addons menu at the same time no matter how many of them there are and doesn't matter if there is a cached menu on disk or how old it is. This can leave a page of widgets with spinning waiting indicators for many a long period, in some cases over a minute.

If there is limited memory, then this can often lead to crashing or memory managers killing the process due to too many addons loading at once

Possible Fix

Kodi should use the cached menu, regardless of how old initially so startup is fast. and then queue the actual call to the addon menu and refresh the widget once the menu has been cached again, thus limited the number of addons running simultaneously and letting the user browse some content even if its stale. Many lists don't change that often so in many cases the list would be unchanged.

To Reproduce

Steps to reproduce the behavior:

  1. Pick a skin with widgets
  2. Pick a plugin that allows caching it's menus
  3. Add widgets that point to the addon menus
  4. Open once and let the wdigets load
  5. Restart then notice the delay before the widgets are loaded.

Debuglog

  • not applicable

Screenshots

Here are some links or screenshots to help explain the problem:

  • not applicable

Additional context or screenshots (if appropriate)

Here is some additional context or explanation that might help:

None

Your Environment

Used Operating system:

  • [x] Android

  • [x] iOS

  • [x] tvOS

  • [x] Linux

  • [x] macOS

  • [x] Windows

  • [x] Windows UWP

  • Operating system version/name: all

  • Kodi version: 18.0-Leia - latest

djay avatar Nov 17 '23 08:11 djay