Go Down

Topic: BENCHMARK: ESP32, ESP8266, ARDUINO-DUE, TEENSY3.6, ... (Read 15861 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...
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
ATtiny breakouts, mosfets, 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             


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     


Mar 05, 2020, 06:32 pm Last Edit: Mar 05, 2020, 06:34 pm by TFTLCDCyg
Nucleo H743ZI @ 552 MHz

floating point calculations = 30
integer calculations =           2

Go Up