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
Improve performance for :meth:.Mobject.become
#2508
Merged
Darylgolden
merged 25 commits into
ManimCommunity:main
from
Darylgolden:performance-speedup
Jan 29, 2022
Merged
Improve performance for :meth:.Mobject.become
#2508
Darylgolden
merged 25 commits into
ManimCommunity:main
from
Darylgolden:performance-speedup
Jan 29, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for more information, see https://pre-commit.ci
…manim into performance-speedup
for more information, see https://pre-commit.ci
Docs build has dropped from ~980 seconds to ~930 seconds 💯 |
…manim into performance-speedup
for more information, see https://pre-commit.ci
…manim into performance-speedup
behackl
approved these changes
Jan 29, 2022
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.
LGTM! Left one suggestion for documentation, but other than that this looks good to me.
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
Darylgolden
commented
Jan 29, 2022
…manim into performance-speedup
behackl
changed the title
Improve performance for :meth:
Improve performance for :meth:Feb 20, 2022
~become
.Mobject.become
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Overview: What does this pull request change?
skip_point_alignment
to thealign_data
method. When True, the expensive point alignment method is not called.align_data
method.become
method.Motivation and Explanation: Why and how do your changes improve the library?
While profiling the following scene:
I noticed that Manim was spending an inordinate amount of time on the
become
method of Mobject. In particular, when using thebecome
method for VMobjects, a lot of time is wasted aligning the points of the VMobject to its target. This is despite the fact that thebecome
method simply changes aVMobject
's point data to match its target, with no need to interpolate where its initial points should lie (that will immediately get overwritten). Skipping point alignment caused the render time for the above scene on medium quality on my PC to drop from 80 seconds to 15 seconds with Cairo. For OpenGL, the time spent on the become method was already negligible, so I left it untouched.Links to added or changed documentation pages
Further Information and Comments
Reviewer Checklist