Update GUI Runner initial state request timing (backport #3044) #3046
+3
−2
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.
🦟 Bug fix
Related issue: gazebosim/jetty_demo#3
Summary
While testing the Jetty demo world, it was found that Gazebo took a while to load because there is a large number of entities in the world. The slow down is mainly on the GUI side. One cause of the long load time was found to be that the GuiRunner setting its ECM initial state twice: Once from the async state request and the other from the state topic subscription callback (sync version).
More info:
There was a PR (#1073) to only start the processing the states from topic subscription callback (sync version) only after the async version is done, which is tracked using the
this->dataPtr->receivedInitialState
bool variable. That worked fine until this merge forward change that changed the processing of the state request in the aysnc callback to aQueuedConnection
. As the result, the state is not processed immediately butthis->dataPtr->receivedInitialState
is incorrectly marked astrue
. This causes the sync version to start processing states right away.The fix is to properly set
this->dataPtr->receivedInitialState
totrue
in the state callback function after the states are actually processed.This patch reduces the load time by ~15 seconds (from ~1min 10sec to ~55 sec) on my machine.
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.This is an automatic backport of pull request #3044 done by [Mergify](https://mergify.com).