plugin.video.auvio icon indicating copy to clipboard operation
plugin.video.auvio copied to clipboard

cache expiration - huge performance issue with @common.plugin.cached

Open cvandeplas opened this issue 6 years ago • 2 comments

TLDR: over time the $HOME/.kodi/userdata/addon_data/plugin.video.auvio/__cache__.pcl file becomes big and causes a large performance problem on low performance systems.

Long story:

The audio plugin is terribly slow on my raspberry pi. On a normal laptop it is relatively fast.

A good place to see how slow it is, is the "Mon Auvio" (menu_favorites) menu. Finally, digging into the code the function get_media_details is terribly slow on my raspberry:

'get_media_details' ((2329504,), {}) 2.51 sec

As this function is called for each media item, the user needs to wait for about 1 minute to see te results. This decorator is actually calling the function from the simpleplugin::Plugin object, in the simpleplugin library included in this github repo.

I believe the objective is to temporarily store data in a cache for fast lookups, which seems to be working. However this database becomes big over time (> 4 MB), and on low performance systems (raspberry) this causes a massive performance hog, as there seems to be nothing doing expiration of the cache.

I'm curious to know if other users have this issue. How should we handle this cache expiration?

cvandeplas avatar Dec 29 '18 21:12 cvandeplas

I believe the objective is to temporarily store data in a cache for fast lookups, which seems to be working. Yes it is, but the SimplePlugin Cached Decorator should only store the datas for a few minutes. I don't have the time to have a look right now, but i'll probably have a look within some weeks.

Thanks for your report. I you find something please tell here!

rickybiscus avatar Jan 26 '19 20:01 rickybiscus

Hello, i'm having the same issue with OSMC on a RaspberryPi 3. I haven't tried with the version 3.2.2 of the plugin though (OSMC is still using python 2.7.16, so not sure it is currently compatible...)

denisvr163 avatar May 15 '21 15:05 denisvr163