Go Down

Topic: BENCHMARK: ESP32, ESP8266, ARDUINO-DUE, TEENSY3.6, ... (Read 8492 times) previous topic - next topic

I just finished my last project that is based on a TEENSY3.1 and an ESP8266 wifi module (s. here: https://www.youtube.com/watch?v=zBBMsm8kIlg) 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!

Code: [Select]

void setup() {
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.print("a = ");
  Serial.print("dT[ms] = ");
  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.print("b = ");
  Serial.print("dT[ms] = ");
//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...
ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy



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!



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             

Go Up