obfuscated-loop / plugin.video.fenda

A WIP fork of Fen
https://fenda.live/
GNU General Public License v3.0
3 stars 0 forks source link

General speedup of database operations #4

Closed obfuscated-loop closed 8 months ago

obfuscated-loop commented 9 months ago

The problem: It seems like the vast majority of load time is spent on waiting for SQLite operations to complete, this is probably due to cursors being created for nearly almost every database transaction. To speed things up, we need to use the database connection directly for SQL executions. A cursor can also be created by assigning an SQL execution (execute()) to a variable if one is really needed.

https://remusao.github.io/posts/few-tips-sqlite-perf.html

Checklist: (to be filled out) [list created by searching for execute()] resources/lib/apis/alldebrid_api.pyresources/lib/apis/easynews_api.pyresources/lib/apis/furk_api.pyresources/lib/apis/imdb_api.pyresources/lib/apis/premiumize_api.pyresources/lib/apis/real_debrid_api.py

resources/lib/caches/base_cache.pyresources/lib/caches/debrid_cache.pyresources/lib/caches/favorites_cache.pyresources/lib/caches/main_cache.pyresources/lib/caches/meta_cache.pyresources/lib/caches/navigator_cache.pyresources/lib/caches/providers_cache.pyresources/lib/caches/trakt_cache.py

resources/lib/indexers/dialogs.pyresources/lib/indexers/discover.py

resources/lib/modules/kodi_utils.pyresources/lib/modules/source_utils.pyresources/lib/modules/watched_status.py

TwilightMercy commented 9 months ago

Nice! at what point in using Fen/Fenda will the change be noticeable?

obfuscated-loop commented 9 months ago

Nice! at what point in using Fen/Fenda will the change be noticeable?

The API calls already seem a bit faster on my local, but that could easily be an illusion and wishful thinking :smile: Once I have completed fixing the stuff mentioned in this issue, it should theoretically be more than noticeable.

obfuscated-loop commented 9 months ago

Sorry!

Only just understood what you meant, SQLite operations take place when collecting cached data from within Fen. So when you're loading up certain menus or pages etc - Fenda, when updated fully, should eliminate a big portion of this load time.

TwilightMercy commented 9 months ago

Thanks for explanation, waiting to test it!

obfuscated-loop commented 8 months ago

Thanks for explanation, waiting to test it!

It is now available to test from zip at https://fenda.live/ 👍 I have a few commits on my local which I have yet to push but I am nearly done with the database speedup. As I haven't made a repo addon yet, you will just have to install from zip file etc. Let me know how it goes.

Gemini88 commented 3 months ago

@obfuscated-loop fenda live is down or is development not happening at the moment because all other fen addons have that annoying pop-up of playback failed after stopping video or sometimes navigating through menus. Was hoping your addon would change all of that

obfuscated-loop commented 3 months ago

@Gemini88 Sorry mate, I had been meaning to archive this project really. I slowly noticed there was just too much wrong with the original Fen to make this a viable fork - I've debated creating my own add-on but haven't had the time thus yet to make a start as I'm currently looking for work etc...

I'm not sure about this bug you're encountering specifically, but you're free to download/clone this Git repo as a zipfile and install it manually on your machine to test. Repo is down though.

There's also Fen Light to consider which Tiki has been working on which is an ultra stripped down version of the original Fen.