-
Notifications
You must be signed in to change notification settings - Fork 112
Optimize load time and memory consumption by reusing element descriptions #1589
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
Conversation
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
I think the side-effect of this change is that if the user manually updates the element description of one |
I'm thinking about deprecating the |
👍 to update migration guide
👍 to proposed APIs |
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
I've added the new API and updated the migration guide. Could you take another look? |
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
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.
changes seem reasonable to me, though I haven't tested with gz-sim. I've left some minor comments and opened azeey#2 with all the suggested changes
Signed-off-by: Steve Peters <scpeters@openrobotics.org>
* Reword comments, Migration guide * Remove duplicate line in python test * Add / adjust //// lines Signed-off-by: Steve Peters <scpeters@openrobotics.org>
Thanks for all the suggestions @scpeters. I've merged your PR. |
…ions (backport #1589) Signed-off-by: Carlos Agüero <caguero@osrfoundation.org>
🦟 Bug fix
Toward gazebosim/jetty_demo#3
Summary
As far as I can tell, element descriptions are not mutated, so there is no reason to clone them. But I'm not 100% sure if this has unintended consequences.
I created a small test where a large sdf is loaded to show the before and after memory consumption results:
Before
$ time build/sdf_memory 3k_shapes.sdf Successfully loaded file 8647.16MB build/sdf_memory 3k_shapes.sdf 6.77s user 3.13s system 99% cpu 9.904 total
After
$ time build/sdf_memory 3k_shapes.sdf Successfully loaded file 289.069MB build/sdf_memory 3k_shapes.sdf 0.40s user 0.19s system 97% cpu 0.611 total
This is a significant speedup and reduction in memory usage, so it would be worth figuring out if we can truly do this without any negative consequences.
Checklist
codecheck
passed (See contributing)Generated-by: Remove this if GenAI was not used.
Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
andGenerated-by
messages.