BENCHMARK: ESP32, ESP8266, ARDUINO-DUE, TEENSY3.6, ...

I just finished my last project that is based on a TEENSY3.1 and an ESP8266 wifi module (s. here: WIFI-NEWSFEEDREADER IN A MATCHBOX (based on TEENSY3.1 and ESP8266-03; programmed with ARDUINO-IDE) - YouTube) when I was told that I could have done the whole thing without the Teensy, but only with the ESP8266 as there is an ARDUINO-IDE-addon available that enables to program the ESP8266 with the ARDUINO-IDE. I immediately tried it and a simple test-program worked on the first try. I’m not sure if I will manage to port the code of the FEEDREADER as I don’t know if I will make “u8glib” work with the ESP8266, but I first decided to do a simple benchmark to see how fast the ESP8266 is in comparison to a TEENSY3.1 and an ARDUINO-DUE.

BENCHMARK RESULTS (smaller values are better):
ESP8266 @80MHz TEENSY3.1 @72MHz ARDUINO DUE @84MHz
“float” [ms] 431 564 636
“int” [ms] 56 12 28

ESP8266 @160MHz TEENSY3.1 @96MHz
“float” [ms] 216 505
“int” [ms] 28 9

It seems that the ESP8266 is good with float (floating point unit inside?), but relatively bad with integer!

void setup() {
  Serial.begin(115200);
}
void loop() {
  float a = (float) millis();
  int time = millis();
  for (int i = 0; i < 100000; i++) a += a * a + 1000.7 / a - 40.4;
  time = millis() - time;
  Serial.println("floating point calculations");
  Serial.println("---------------------------");
  Serial.print("a = ");
  Serial.println(a);
  Serial.print("dT[ms] = ");
  Serial.println(time);
  Serial.println("");
  time = millis();
  int b = time;
  for (int i = 0; i < 100000; i++) b += b * b + 1000 / b - 40;
  time = millis() - time;
  Serial.println("integer calculations");
  Serial.println("------------------");
  Serial.print("b = ");
  Serial.println(b);
  Serial.print("dT[ms] = ");
  Serial.println(time);
  Serial.println("");
  delay(1000);
}
//I first tried it with trigonometry-functions, but the ESP8266 crashed!

It doesn't so much look like it's good with floats as bad with integers to me...

Try again with long int..

pito: Try again with long int..

...the same result!

It seems the 8266 does not include FPU as an 32bit FPU does the math you use in the benchmark 10-20x faster. It might be the 8266 is an MIPS and the others are ARMs so the math implementation efficiency may differ.

I know this is an old topic, but hey :-) I just ran this same benchmark on my brand new Teensy 3.6 @180MHz It came out with: Float: 139ms Int: 50ms

BUT: this is after increasing the number of runs 10 fold, that is, running 1,000,000 instead of 100,000 - this would render the 3.6 roughly 30 times faster for float and just under 10 times faster for int calculations than the ESP8266. Not bad at all.

Running at the maximum Overclock frequency of 240MHz, those numbers change to: Float: 104ms Int: 38ms.

again, if you want to compare those figures to the ones reported further up in this thread, divide them by 10!

pj

I know this topic is even older now XD but whatever... I would like to prestent how the old good arduino uno is doing :)

Arduino uno @16MHz ESP8266 @80MHz TEENSY3.1 @72MHz ARDUINO DUE @84MHz "float" [ms] 3326 431 564 636 "int32" [ms] 4446 56 12 28

I would like to mention that Arduino core is 8 bit while others are 32 bit which shows big difference on int32 computing task.

PS: needed to modify test code to use "long int"(32bit) instead of "int" which is 16 bit on arduino uno....

ESP32 added (Thanks to pjakobs and nogard111 for their contributions!):

Arduino uno @16MHz ESP8266 @160MHz TEENSY3.1 @96MHz ARDUINO DUE @84MHz "float" [ms] 3326 216 505 636 "int32" [ms] 4446 28 9 28

ESP32 @240MHz TEENSY3.6 @240MHz "float" [ms] 95 10 "int32" [ms] 3 4

1 Like

Fantastic thread! I hope this remains open for future upgrades to this benchmark.

I use the ESP8266 extensively on projects for industrial-type process control where internet connection is required. Two implementations use a ESP8266 as central controller for over a year now without one single reboot, reset or lost internet connections. Maybe I miss something but I do not understand the fuss about the Teensy: the ESP8266 has -in my maybe prejudiced opinion- all the features (except number of I/O) at least of a Teensy, plus internet connectivity. I developed my own ESP8266 production PCB, it includes a auto-reset programming feature (I use DTR to automatically set the chip in program mode, no need to fuss with handling wires to get the chip in program mode) and although about 8 I/O pins is very limited, to me it is more than enough to handle process control projects. If insufficient I/O there now is the ESP32.

Sorry to revive an old thread, but is there a bench for the Mega 2560?

e: wait...I'm seeing it's 16mhz, same as the 328....does that mean it's going to have the same processing time?

The 2560 will be slightly slower than the 328 (because some instructions take longer to access the larger memory.)

Teensy 4.0

floating point calculations

a = inf dT[ms] = 3

integer calculations

b = 1996356228 dT[ms] = 1

Here is my results STM32F103 @72Mhz

STM32F103 @72Mhz
“float” [ms] 634
“int” [ms] 21

Nucleo H743ZI @ 552 MHz

floating point calculations = 30 integer calculations = 2