CPU/RAM usage and performance Nicla vision board

Regarding performance monitoring on the Nicla Vision Board, could you provide insights into how one can effectively measure CPU and RAM usage, as well as overall system performance? Additionally, are there any recommended tools or techniques for monitoring and optimizing performance in real-time?

Hi, you can print out the heap stats using the micropython module. As for CPU usage, the system automatically busy sleeps on any blocking I/O calls like when you call snapshot(). If your algorithm speed is lower than the FPS then you’re maxed out on CPU already. If not, then there’s some CPU performance left.

If you are maxing out on the frame rate then you’d just look at the microseconds elapsed between snapshot calls. Average those and then divide them by a fixed goal value and you’ll get a percentage that tells you your CPU load.

That said, if you’re maxing out the camera FPS this process isn’t really needed… you know pretty directly if the processor is unloaded if you are running faster than the camera or if you are 100% loaded if you are running slower.