Skip to content
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

Maya Tool - Adding/Removing nodes to the Solver causes UI slow updates #18

Closed
david-cattermole opened this issue Feb 24, 2019 · 4 comments
Assignees
Labels
bug core solver Related to the low-level solver functions. maya tool A user tool inside Maya. user interface Related to a User Interface (Maya or Qt)
Milestone

Comments

@david-cattermole
Copy link
Owner

When adding or removing many nodes with many frames, the solver UI is especially slow.

This is caused by the "solver steps" needing to compile down to individual keyword arguments, for each frame. This loop in Python is much slower than anticipated when it was written.

We should:

  1. Diagnose the slow-down of the Python loop
  2. Refactor the feature and push the loop into code that can execute faster.
  3. Or, if all else fails as a short term fix, we can provide an "update" button the user must click to update the UI.

We also need to investigate the possible problems caused by using Maya callbacks to update the UI perhaps we can intelligently process the updates once, rather than each time a node is added.

@david-cattermole david-cattermole added bug maya tool A user tool inside Maya. core solver Related to the low-level solver functions. user interface Related to a User Interface (Maya or Qt) labels Feb 24, 2019
@david-cattermole david-cattermole added this to the v0.3.0 milestone Feb 28, 2019
@david-cattermole david-cattermole modified the milestones: v0.3.0, v0.2.0 Mar 3, 2019
@david-cattermole david-cattermole self-assigned this Mar 3, 2019
@david-cattermole
Copy link
Owner Author

This issue is related to #44.

After doing some profiling most of the slowness seems to be caused 50% from compiling the Solver UI "Solver Steps" into "Solvers", and another 50% from calling Collection.is_valid() (which compiles the collection under the hood).

However another source of slowdown is multiple callbacks (one for each changed attribute) triggering updates to the UI. This UI update is fairly fast and is not noticable for small scenes or small frame ranges, however longer frame ranges and multiple attribute causes slow downs.

If there are less frames in the solver steps, then this problem is less apparent.

I will attempt to address this problem by:

  • reducing the need to update the UI for each attribute change and instead calling the UI only once after a batch of attributes are locked/unlocked.
  • refactor the Collection compiling logic, for performance.

To test the performance, use the "Toggle Bundle Lock" tool in a Collection with many attributes added to the UI.

@david-cattermole david-cattermole modified the milestones: v0.2.0, v0.3.0 Mar 22, 2019
@david-cattermole
Copy link
Owner Author

A third option has been used to temporarily fix the slow-down effect.

When adding components to the Solver UI the the triggered callbacks needed to update the UI. Each update caused a re-compile of the Solver Steps. Since this re-compile was actually unneeded, it has been removed until needed later. The result has been to speed up the UI considerably, however the true underlying problem still exists and should be fixed.

The end date on this issue can be delayed for another release.

@david-cattermole
Copy link
Owner Author

This issue can be delayed until another release.

A performance problem was fixed in the Solver UI which caused any edits to the UI to re-compile the "Solver Steps". This re-compile is unneeded and has been removed resulting in better UI performance.

@david-cattermole
Copy link
Owner Author

In the latest commits, the performance of adding/removing attributes has been improved.

Any new performance issues with adding/removing should addressed in a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug core solver Related to the low-level solver functions. maya tool A user tool inside Maya. user interface Related to a User Interface (Maya or Qt)
Projects
None yet
Development

No branches or pull requests

1 participant