You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Ability to load attributes on demand then to cache them instead of loading them on object instantiation #1509
After profiling my program that relies on python-plexapi, I found that _loadData was the function with the highest CPU time (~65% of the program's total CPU time).
This is largely because python-plexapi loads all available attributes on object instantiation. Most of which never get used. Instead, I suggest attributes get loaded on demand and then cached (with the cache key changing whenever the _data attribute changes).
For my use cases, where I only need access to the ratingKey, guid, viewCount, lastViewedAt, rating attributes. Using on demand access would cut down _loadData's runtime by over 80% in this scenario (according to my rough estimate from the flame graph below).
Activity