Esp32 C3 seems to perform better than s2 at same clock speed
Posted: Thu Dec 12, 2024 3:02 pm
I have written some code to benchmark the Integer performance of esp32 series chips i have ( esp32, esp32 s2, esp32 s3 and esp32 c3). I know Risc v is still being optimized but somehow benchmark shows that esp32 C3 @ 160 MHz (DIO) performs better than chips like esp32 s2 @ 160 MHz ( QIO ). I dont know if my code is faulty or if the c3 is just as fast as it seems.
the esp32 s2 gets 12 MIops when clocked at 160 MHz
esp32 c3 (DIO) @ 160 MHz --- Add -> 17.6 MIops
esp32 (QIO) @ 240 MHz --- Add -> 18.39 MIops
esp32 s2 (QIO) @ 240 MHz --- Add -> 18.40 MIops
esp32 s3 (QIO) @ 240 MHz --- Add -> 23.88 MIops
Code i used to test them:
Code test the time it takes for each chip to do 1m operations in microseconds then finds out how much it can do in 1s.
the esp32 s2 gets 12 MIops when clocked at 160 MHz
esp32 c3 (DIO) @ 160 MHz --- Add -> 17.6 MIops
esp32 (QIO) @ 240 MHz --- Add -> 18.39 MIops
esp32 s2 (QIO) @ 240 MHz --- Add -> 18.40 MIops
esp32 s3 (QIO) @ 240 MHz --- Add -> 23.88 MIops
Code i used to test them:
Code: Select all
void Add()
{
uint32_t AInt = 0;
uint32_t Num0 = 314;
Serial.println(" *** Add Time ***");
unsigned long clock0 = micros();
for(int i = 0; i < Loops;i++)
{
asm volatile("" : : : "memory"); // Prevent optimization
AInt = AInt + Num0;
}
float pclock = (micros() - clock0);
Iops = mtime / pclock;
AInt -= 10;
//Serial.print(pclock);
Serial.print("Final Value: ");
Serial.println(AInt);
Serial.print(Iops);
Serial.println(" MIops");
}