bluerobotics / cockpit

An intuitive and customizable cross-platform ground control station for remote vehicles of all types.
https://docs.bluerobotics.com/ardusub-zola/software/control-station/Cockpit-1.0/overview/
Other
43 stars 18 forks source link

The process of scanning for generic variables (and their values) is CPU intensive #937

Closed rafaellehmkuhl closed 1 month ago

rafaellehmkuhl commented 2 months ago

In the ArdupilotVehicle class we have a method called getDeepVariables, which is responsible for scanning each incoming message and storing variables and their values.

Doing some tests, I could see that this operation only is responsible for about 11% of CPU usage on a Mac Air M1 2020 machine. This represents a third to half the CPU usage of Cockpit, when excluding the Map widget.

This operation is responsible for giving life to the VeryGenericIndicator, which is something our users like a lot. Optimizing it would lead to a great performance increase.

rafaellehmkuhl commented 1 month ago

Fixed on #950.