-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Optimization: use EventHandle in Components for scene and layers #7138
Optimization: use EventHandle in Components for scene and layers #7138
Conversation
So this is for merging into |
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. If @mvaligursky also approves, we can merge.
Editor uses engine v1, and most (except one) of our projects are v1, so we work with it in the first place. |
* implement more optimized EventHandle.off * use EventHandle for scene and layers events for improved performance * more EventHandle.off in critical places * asset-reference event handlers * remove uncecessary off's --------- Co-authored-by: Will Eastcott <[email protected]>
cherry picked to main as well |
Depends on: #7137
This PR uses EventHandle.off instead of EventHandler.off to improve performance when disabling renderable components. As a scene and layers callaback arrays can get large in big projects.
In large scenes, disabling renderable components became ~4-8 times faster based on our tests. In one specific scene, disabling half of a scene used to take ~3550ms now it takes ~600ms (~5.9 times improvement).
I confirm I have read the contributing guidelines and signed the Contributor License Agreement.