-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Free typed arrays for instanced models #10731
Conversation
Thanks for the pull request @j9liu!
Reviewers, don't forget to make sure that:
|
Did some performance testing. Here's the difference between heap screenshots, using this Sandcastle:
For runtime performance, I used this Sandcastle, which toggles the
Overall, I believe this PR improved both memory usage and runtime performance. It's now ready for review @ptrgags |
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.
@j9liu looks good, I can reproduce your profiling results. Just a couple comments
@ptrgags updated! |
Updates look good, thanks @j9liu! |
Closes #10421. This addresses the temporary buffers created by
InstancingPipelineStage
. The attributes are loaded as typed arrays for reasons like computing transform matrices, or computing the min/max of the translation attribute if it's not provided. But afterwards, there is no further manipulation of the data, and thus no reason to keep recreating the buffers from those typed arrays.This PR rewrites parts of
I3dmLoader
andGltfLoader
to load in transform attributes as typed arrays only if the rotation attribute is defined (i.e. matrices have to be computed). Additionally, feature IDs were for some reason being loaded as typed arrays, so they have been restricted to loading as buffers instead.TODO: need to profile the changes for
i3dm
s in combination with other functions (those that require rebuilding draw commands)