Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
There have been reports of the Asset Widget being slow to refresh on bigger projects. This resulted in slow launch times of the Loader and Project Manager for listing the assets.
*Where large project is defined as for example 2 seasons of 20 episodes, with each 30 shots. Resulting in 2 * 20 * 30 = 1200 assets and there have been reports of very slow load times
What has changed?
This is an optimization of the method that builds the hierarchy in the asset widget that is much faster for large projects. The way the assets are queried is now optimized to do less queries against the database, allowing it do more caching (as it will hit the same query more often) and have less problems with any delay in the connection with the database as there are much less calls to be made.
Funnily enough, it's also much faster for small projects. Win-win. 🚀
Indication of speed changes
Thanks to the team at pypeclub and @iLLiCiTiT to quickly separate out some commits related to the optimization.