getavalon / core

The safe post-production pipeline - https://getavalon.github.io/2.0
MIT License
218 stars 49 forks source link

Optimize AssetModel refresh time #447

Closed BigRoy closed 5 years ago

BigRoy commented 5 years ago

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.

mottosso commented 5 years ago

Neat, well presented, looks like a no brainer. Feel free to merge when you're happy!

BigRoy commented 5 years ago

Merging this. 👍