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
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).
Pyspy profiler flame graph:
The text was updated successfully, but these errors were encountered:
What is your feature request?
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).Pyspy profiler flame graph:
The text was updated successfully, but these errors were encountered: