Why is multi-tasking on ESP32 dual-cores not faster than single-tasking on one core?

Hi there,

I found out that I had set the refresh rate of the MLX90640 incorrectly. This was a bug caused by my carelessness.

When I changed the refresh rate from 16Hz to 32Hz, everything worked as expected (the MLX90640 outputs one image by combining two samples, so the actual frame rate is halved).

The results were as follows:

ProcessInput() [ms] ProcessOutput() [ms] Frame rate [Hz]
Single-core sequential processing 74 52 7.9
Multi-cores parallel processing 64 52 15.6

Also, I made a mistake in my previous post, so I've completely revised it.

The ESP32S3 CPU access SPI and I2C via the APB. As a result, I think that the contention on the APB was not a problem.


I'll add some more information.

Current consumption

ESP32S3 I2C clock

The S3 data sheet says up to 800KHz.

When I set the I2C clock to 1MHz, and then read the set value, 1MHz will be returned.

  // I2C bus clock for MLX90640
  // Note: ESP32S3 supports up to 800 MHz
  Wire.setClock(1000000); // 400 KHz (Sm) or 1 MHz (Fm+)
  // Serial.println(Wire.getClock()); // 1000000

However, I actually measured it with an oscilloscope and found it to be 800KHz.


I'd add this post as it might be useful to someone.
Thank you.