I’m using Edge Impulse to build a Tiny ML test application to classify audio.
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
Here is my platform.ini:
[env:nano33ble]
platform = nordicnrf52
board = nano33ble
framework = arduino
lib_deps =
SNMArduino
ArduinoBLE
BluetoothManager
PDM
LED
; extra_scripts = extra_script.py
upload_port = /dev/ttyACM0
[env:esp-wrover-kit]
platform = espressif32
board = esp-wrover-kit
framework = arduino
lib_deps =
SNMArduino`Preformatted text`
ArduinoBLE
BluetoothManager
PDM
LED
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 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. I can provide the complete compiler command lines for a sample C++ file for each IDE if needed.
I run PlatformIO and the Arduino IDE in an Ubuntu WSL instance.
Thanks in advance for your help!