Question/Issue:
Using the Edge Impulse example for keyword detection, I see a very large performance difference between a PlatformIO build and the same code built using the Arduino IDE.
For the Arduino Nano 33 BLE, the DSP processing block is almost 6X slower when the application is built using PlatformIO versus the Arduino IDE. However, for an ESP32 DevKitC (env:esp-wrover-kit) target, the two builds are comparable in performance. Here is a summary of the DSP times:
PlatformIO
Arduino Nano 33 BLE: DSP 857 ms, inference 8 ms, anomaly 0 ms
ESP32 DevKitC: DSP 298 ms, inference 5 ms, anomaly 0 ms
Arduino IDE
Arduino Nano 33 BLE: DSP 128 ms, inference 6 ms, anomaly 0 ms
ESP32 DevKitC: DSP 285 ms, inference 3 ms, anomaly 0 ms
Project ID:
542383
Context/Use case:
The application code is the same. It classifies a static frame of audio data. I chose the Arduino library deployment option in Edge Impulse. The resulting source is then added as a library to my build.
Any ideas why the performance is much faster with the Arduino IDE build? Again, it’s just for the Arduino Nano 33 BLE target. The ESP32 builds are roughly the same.
I run PlatformIO and the Arduino IDE in an Ubuntu WSL instance.
Steps Taken:
I have done verbose builds on each platform to compare the compiler options and defines but I don’t see anything obvious, but I am new to this domain. Please see the links below for the build logs and complete compiler command lines for a sample DSP file for each IDE.
I have reviewed the Slow DSP Operations
It looks like both the Arduino IDE and PlatformIO use the same version of mbed (6.17.0) per mbed_version.h.
Adding the defines to my source per the article did not make a difference in the DSP processing times. PlatformIO is still significantly slower (~850ms vs 130ms).
#define EIDSP_USE_CMSIS_DSP 1
#define EIDSP_LOAD_CMSIS_DSP_SOURCES 1
Environment:
-
Platform: [Arduino Nano 33 BLE]
-
Arduino IDE Environment Details:
Arduino IDE
Version: 2.3.4
Date: 2024-12-03T10:51:12.539Z
CLI Version: 1.1.1 -
PlatformIO Environment Details:
Core: 6.1.16
I run PlatformIO and the Arduino IDE in an Ubuntu WSL instance.
- Edge Impulse Version
#define EI_STUDIO_VERSION_MAJOR 1
#define EI_STUDIO_VERSION_MINOR 65
#define EI_STUDIO_VERSION_PATCH 3
-
Project Version:
542383
I also opened an issue on the PlatformIO community forum:
Edge Impulse DSP Block (Arduino Nano 33 BLE): Arduino IDE Build 6X Faster
Thanks in advance for your help.