Skip to content

Comments

Fix performance issues in the Map widget and Mission Planning#1604

Merged
rafaellehmkuhl merged 1 commit intobluerobotics:masterfrom
rafaellehmkuhl:unbind-map-object-from-vue
Nov 21, 2025
Merged

Fix performance issues in the Map widget and Mission Planning#1604
rafaellehmkuhl merged 1 commit intobluerobotics:masterfrom
rafaellehmkuhl:unbind-map-object-from-vue

Conversation

@rafaellehmkuhl
Copy link
Member

@rafaellehmkuhl rafaellehmkuhl commented Jan 21, 2025

This patch moves the Leaflet map objects in the Map widget and Mission Planning view to use ShallowRef instead of Ref, which basically makes Vue to stop tracking changes to the attributes of those objects (1st degree or deeply nested), and instead just track reassignments of the objects themselves.

This change drastically improves performance on those maps, as can be seen from the screenshots below.

Ref:
SCR-20251121-iwng

ShallowRef:
SCR-20251121-jbtd

While with deep Ref tracking the system oscillates with drops to 50% of the intended frame-rate, with the ShallowRef we never oscillated more than 10%.

This change also ends up fixing a bunch of erros in the console related to re-binding and losing reference of the map objects.

@rafaellehmkuhl rafaellehmkuhl force-pushed the unbind-map-object-from-vue branch 2 times, most recently from 34f43ef to 3c62703 Compare January 22, 2025 12:15
This fixed the problem of Vue trying to keep track of changes in deeply nested features of the Map object and others, which was causing severe performance issues.
@rafaellehmkuhl rafaellehmkuhl force-pushed the unbind-map-object-from-vue branch from 3c62703 to 1a51ef5 Compare November 21, 2025 12:56
@rafaellehmkuhl rafaellehmkuhl changed the title map: Unbind Leaflet map object from the Vue reference system Fix performance issues in the Map widget and Mission Planning Nov 21, 2025
@rafaellehmkuhl rafaellehmkuhl requested review from ArturoManzoli and ES-Alexander and removed request for Williangalvani November 21, 2025 12:57
@rafaellehmkuhl
Copy link
Member Author

rafaellehmkuhl commented Nov 21, 2025

@ArturoManzoli @ES-Alexander this is the actual fix for the performance problems in the maps. I've committed the rebased changes to this old PR as it was the original solution.

Copy link
Contributor

@ES-Alexander ES-Alexander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested with SR0_POSITION=50, SIM_GPZ_HZ=50, and SIM_SPEEDUP=2, with ArduSub SITL. Both browser and application were improved.

Definitely makes things more stable, and locks in the frame rate - nice work! :-)

@rafaellehmkuhl
Copy link
Member Author

I tested with SR0_POSITION=50, SIM_GPZ_HZ=50, and SIM_SPEEDUP=2, with ArduSub SITL. Both browser and application were improved.

Definitely makes things more stable, and locks in the frame rate - nice work! :-)

Vamooooooo

@rafaellehmkuhl rafaellehmkuhl merged commit cd489c5 into bluerobotics:master Nov 21, 2025
12 checks passed
@rafaellehmkuhl rafaellehmkuhl deleted the unbind-map-object-from-vue branch November 21, 2025 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants