-
Notifications
You must be signed in to change notification settings - Fork 276
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 load times by skipping serialization of entities when unecessary. #2596
Conversation
I was investigating gazebosim/gazebo_test_cases#1576 , in my investigation it came to my notice that `sdf::Element` takes forever to destroy (We should open a ticket somewhere about this). If we are skipping serialization we might as well not create and destroy an SDF Element. This hack greatly speeds up the load time for gazebo. Signed-off-by: Arjo Chakravarty <[email protected]>
I remember we added this serializing of |
All that I remembered was that it started motivated to support scaling. I'm not sure if after that any other piece is using it. |
cc: @caguero Should we remove the serialization all together then? The speed up from removing it is quite a bit. Each model instance takes about 0.1s to deserialize (which is not very good). I do think we should eventually address the root cause which I've documented here: gazebosim/sdformat#1478 |
@arjo129 having long load times is not great, but since this has been an issue for a long time and only affects loading large files, I would not consider it a critical bug. I'd rather not make this change while we are in code freeze. |
Sure lets revisit this after the release. That being said, I would say that 3k worlds only loads on the largest computer I have access to (which happens to be a cloud instance). It fails to load on any of my local machines. This fix also makes loading openrmf demo worlds a lot faster. |
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
…//github.com/gazebosim/gz-sim into arjo/fix/a_hack_to_greatly_improve_loadtimes
the Examples test failure is unrelated, and should be fixed by #2649 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2596 +/- ##
==========================================
- Coverage 68.80% 68.78% -0.02%
==========================================
Files 341 341
Lines 33037 33052 +15
==========================================
+ Hits 22730 22736 +6
- Misses 10307 10316 +9 ☔ View full report in Codecov by Sentry. |
this branch is based on |
🤦 Thanks for spotting that! |
Signed-off-by: Arjo Chakravarty <[email protected]>
Not sure why CI is still ❌ on this. Seems unrelated. |
@osrf-jenkins run tests please |
https://github.com/Mergifyio backport gz-sim9 gz-sim8 ign-gazebo6 |
✅ Backports have been created
|
…ary. (#2596) * A hack to greatly improve load times I was investigating gazebosim/gazebo_test_cases#1576 , in my investigation it came to my notice that `sdf::Element` takes forever to destroy (We should open a ticket somewhere about this). If we are skipping serialization we might as well not create and destroy an SDF Element. This hack greatly speeds up the load time for gazebo. Signed-off-by: Arjo Chakravarty <[email protected]> * Remove magic word Signed-off-by: Arjo Chakravarty <[email protected]> * Send empty string instead of using sentinel value. Signed-off-by: Arjo Chakravarty <[email protected]> * Style Signed-off-by: Arjo Chakravarty <[email protected]> * fix custom sensor system example build (#2649) Signed-off-by: Ian Chen <[email protected]> * remove stray change Signed-off-by: Arjo Chakravarty <[email protected]> --------- Signed-off-by: Arjo Chakravarty <[email protected]> Signed-off-by: Ian Chen <[email protected]> Co-authored-by: Ian Chen <[email protected]> (cherry picked from commit 1a88131)
…ary. (#2596) * A hack to greatly improve load times I was investigating gazebosim/gazebo_test_cases#1576 , in my investigation it came to my notice that `sdf::Element` takes forever to destroy (We should open a ticket somewhere about this). If we are skipping serialization we might as well not create and destroy an SDF Element. This hack greatly speeds up the load time for gazebo. Signed-off-by: Arjo Chakravarty <[email protected]> * Remove magic word Signed-off-by: Arjo Chakravarty <[email protected]> * Send empty string instead of using sentinel value. Signed-off-by: Arjo Chakravarty <[email protected]> * Style Signed-off-by: Arjo Chakravarty <[email protected]> * fix custom sensor system example build (#2649) Signed-off-by: Ian Chen <[email protected]> * remove stray change Signed-off-by: Arjo Chakravarty <[email protected]> --------- Signed-off-by: Arjo Chakravarty <[email protected]> Signed-off-by: Ian Chen <[email protected]> Co-authored-by: Ian Chen <[email protected]> (cherry picked from commit 1a88131)
…ary. (#2596) * A hack to greatly improve load times I was investigating gazebosim/gazebo_test_cases#1576 , in my investigation it came to my notice that `sdf::Element` takes forever to destroy (We should open a ticket somewhere about this). If we are skipping serialization we might as well not create and destroy an SDF Element. This hack greatly speeds up the load time for gazebo. Signed-off-by: Arjo Chakravarty <[email protected]> * Remove magic word Signed-off-by: Arjo Chakravarty <[email protected]> * Send empty string instead of using sentinel value. Signed-off-by: Arjo Chakravarty <[email protected]> * Style Signed-off-by: Arjo Chakravarty <[email protected]> * fix custom sensor system example build (#2649) Signed-off-by: Ian Chen <[email protected]> * remove stray change Signed-off-by: Arjo Chakravarty <[email protected]> --------- Signed-off-by: Arjo Chakravarty <[email protected]> Signed-off-by: Ian Chen <[email protected]> Co-authored-by: Ian Chen <[email protected]> (cherry picked from commit 1a88131) # Conflicts: # include/gz/sim/components/Model.hh
…ary. (#2596) (#2682) * A hack to greatly improve load times I was investigating gazebosim/gazebo_test_cases#1576 , in my investigation it came to my notice that `sdf::Element` takes forever to destroy (We should open a ticket somewhere about this). If we are skipping serialization we might as well not create and destroy an SDF Element. This hack greatly speeds up the load time for gazebo. Signed-off-by: Arjo Chakravarty <[email protected]> Signed-off-by: Ian Chen <[email protected]> Co-authored-by: Ian Chen <[email protected]> (cherry picked from commit 1a88131)
…ary. (#2596) (#2683) * A hack to greatly improve load times I was investigating gazebosim/gazebo_test_cases#1576 , in my investigation it came to my notice that `sdf::Element` takes forever to destroy (We should open a ticket somewhere about this). If we are skipping serialization we might as well not create and destroy an SDF Element. This hack greatly speeds up the load time for gazebo. Signed-off-by: Arjo Chakravarty <[email protected]> Signed-off-by: Ian Chen <[email protected]> Co-authored-by: Ian Chen <[email protected]> (cherry picked from commit 1a88131)
…ary. (backport #2596) (#2684) * Improve load times by skipping serialization of entities when unecessary. (#2596) * A hack to greatly improve load times I was investigating gazebosim/gazebo_test_cases#1576 , in my investigation it came to my notice that `sdf::Element` takes forever to destroy (We should open a ticket somewhere about this). If we are skipping serialization we might as well not create and destroy an SDF Element. This hack greatly speeds up the load time for gazebo. Signed-off-by: Arjo Chakravarty <[email protected]> Co-authored-by: Arjo Chakravarty <[email protected]> Co-authored-by: Arjo Chakravarty <[email protected]>
🦟 Bug fix
Fixes #
Summary
I was investigating
gazebosim/gazebo_test_cases#1576 , in my investigation it came to my notice that
sdf::Root
takes a long time to be constructed. While I am submitting changes upstream to reduce the impact of the creation ofsdf::Root
, in the event that we don't serialize a model, I'm proposing we just send an empty string accross. This should minimize both network traffic and make load times more manageable.Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸