-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Asset switcher efficiency enhancement #551
Asset switcher efficiency enhancement #551
Conversation
…tion about selection on switch dialog init
…s happened during `refresh` method
…presentation combobox
… are switched at once
bool(missing_assets) | ||
or bool(missing_versions) | ||
or bool(missing_subsets) | ||
or bool(missing_repres) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line break before binary operator
self.missing_docs = ( | ||
bool(missing_assets) | ||
or bool(missing_versions) | ||
or bool(missing_subsets) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line break before binary operator
|
||
self.missing_docs = ( | ||
bool(missing_assets) | ||
or bool(missing_versions) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line break before binary operator
I believe @jasperges recently tested this feature and it "worked fine" for his needs. I believe @iLLiCiTiT at pype has also updated a variant of this code change. Should we get this merged? |
@tokejepsen found a bug. ynput/OpenPype#423 |
Now using the asset switcher improvements from getavalon#551.
Problem
Current asset switcher dialog is querying all documents in very inefficient way. The same document may be queried many times in separate database calls which makes asset switcher GUI really slow.
Suggested solution
Query documents of one type only once per each refresh step. So all representations are queried in one call, their versions, subsets and assets are queried in separate calls which means, to get parenthood of all representations needs a maximum of 4 calls to DB. We also validate each step of refresh, to prevent querying data which will not be used. This is not perfect change, it can be done even faster (and more complicated), but the performance improvement over current implementation is significant.
We tested on a feature film with around 400 assets. The speed difference to open the switcher GUI is: 10s with current code, 1-2s with the new code.