Arduino Zero vs Uno why it's the same?

Hello.

Im in the search of faster board so Ive got Zero which should be 3 times faster the rguliar UNO. But it’s not ! Maybe I don’t understans something?

I have Itedamaple 1.0 board. I really like it but it’s just a bit slow for what I need. The speed which is satisfys my needs I can get from teensy. But it’s also have got it’s own other problems.

Anyway why the Arduino Zero works same speed as UNO? It’s only different from UNO by that debag port ant that’s it?

I testing the speed of the boards simply throw counting also it would be better to implement time counting to the final number but for now it’s just like that:

void setup() {

 Serial.begin(57600);
 Serial.println("Privet");
 Serial.setTimeout(100);
 
}
long i = 0;
void loop() {

  if(Serial.available()>0){
    
      String Str = Serial.readString();

      if(Str == "start"){

      for(i=0;i<1000000;i++){

          if(Serial.available()>0){
           Str = Serial.readString();
         if(Str == "stop"){
      //    i=999999;
          break;
           }
        }
      Serial.println(i);
    
  }
  Serial.println("Stop count");
      }else{
        Serial.println(Str);
      }
}
//  delay(100000);

  
}

Anyway why the Arduino Zero works same speed as UNO?

It doesn't. That code does not test the speed of anything except the serial interface and you set that with the baud rate.

See here for some speed test code. http://forum.arduino.cc/index.php?topic=326944.0

What you mean it dosn't test anything? If you will run this for loop on UNO and teensy for example so The teensy will reach the 999999 number like 4 times faster the UNO. Maybe there some adjustable clock speed on Zero?

Or how you explain that ? That the Iteadmaple and teensy gets reach out the loop faster then UNO like 4 times faster. Iteadmaple and teensy seems all 72 but acctually the Itedmaple just a bit slow.

If you want to test the speed of any computer you need to do it with code that does not rely on external features. Otherwise your tests will be confused by the performance of the external elements - in this case whatever is sending the serial data.

Serial.readString() is a particularly bad function for a speed test because it blocks until the full message is received or the timeout interval expires.

If you want to test serial performance have a look at the examples in Serial Input Basics - simple reliable non-blocking ways to receive data. It is my experience that the baud rate accounts for almost all of the performance. In general, however, several short messages will probably perform more poorly than the same amount of data sent as single longer messages

…R

You're mostly testing the Serial.readString() timeout period; what's odd is that the teensy is any faster (that could be a bug in Teensy core w/readString()?).

Slavka85:
If you will run this for loop on UNO and teensy for example so The teensy will reach the 999999 number like 4 times faster the UNO.

You are testing the relative efficiency of the USB / serial interface. A glance at the schematic of each will show you that you are not comparing apples with apples.

Why all of you about this .readString();
This function executes only once to just start the for loop. I understand if you would say something about Serial.println because it’s actually about this function.

So here the code:

if I do not print (i) So just count up to 999999 the result of time is:

UNO - 3853
ZERO - 1043
IteadMaple - 918

But if I print (i) - so the result would be:

IteadMaple - 61335 it goes up to million 999999 it needs just a minut!
ZERO - 119407 and it goes up a hundred thousand 99999 because I will just wait half a day for it.
the UNO it’s even scare to run…

So maybe it’s not the speed test of the board but test of a Serial.print() function. You see Im looking for a board relay on this test because it’s a for Automotive CAN interface. So the iteadmaple misses some massages on the CANbus Im not saying about UNO ofcourses and ZERO now but I don’t get it why… The teensy 3.2 dosn’t miss massages but has other stupid problems…

So why the ZERO is slow like that?. And what other boards can I have to beat result of Iteadmale?

void setup() {

 Serial.begin(57600);
 Serial.println("Privet");
 Serial.setTimeout(100);

}
long i = 0;
 unsigned long TimeStart;
 unsigned long TimeStop;
 

void loop() {

  if(Serial.available()>0){
    
      String Str = Serial.readString();

      if(Str == "start"){

       TimeStart = millis();

      for(i=0;i<1000000;i++){

        /*
          if(Serial.available()>0){
           Str = Serial.readString();
         if(Str == "stop"){
      //    i=999999;
          break;
           }
        }
        */
      Serial.println(i);

//      Serial.write(millis);
    
  }
    // TimeStop = millis();

     long result = millis()-TimeStart;
     Serial.print("The time is-  "); 
     Serial.println(result);
     Serial.println("Stop count");
  
      }else{
        Serial.println(Str);
      }
  }  
}

Slavka85: So just count up to 999999 the result of time is: UNO - 3853 ZERO - 1043 IteadMaple - 918

So the Zero runs about 3 times faster thant the UNO ?

Spot on then, since the Zero clock speed is 3 times faster than the UNO.

srnet: Spot on then, since the Zero clock speed is 3 times faster than the UNO.

Yes! But it has not that speed when it's prints. Trying to figure it out why?

O common... Im sorry guys. Yes the a ZERO 48. The iteadmaple 72 and teensy 72. That's it! That's why!

Is there any board 72 or even faster schematic of UNO?

Slavka85: I testing the speed of the boards simply throw counting

No, that's NOT a performance benchmark test.

Perhaps you better try this:

https://github.com/ghalfacree/Arduino-Sketches/blob/master/Whetstone/Whetstone.ino

It's the WHETSTONE benchmark test for Arduino.

The result printed is WHETSTONE-MIPS, and the result depends on how fast your Arduino can execute single precision floating point math with using 'float' data type.

Faster controllers(meaning "faster in floating point math") should end up with a higher WHETSTONE-MIPS rating in the WHETSTONE benchmark.

I tested the sketch with Arduino UNO and DUE, and the DUE is much faster than the UNO (of course).

Slavka85: Is there any board 72 or even faster schematic of UNO?

Seen the Teensy 3.6? That has a clock speed of 180 MHz, with an ARM Cortex-M4 with Floating Point Unit.