BASIC Speed Benchmark Tests


Author Message
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 1869
Posted: 06:28pm 06 Aug 2018      

ESP32 C benchmark.

Well, this thread hasn't been posted to in a year and 7 months, and this post is using a (slight) modification of the Arduino C code which twofingers posted for benchmarking the ESP32 module, ESP-32S NodeMCU Development Board 2.4GHz, but here goes.

I increased the number of loops to 100000 so I could get sort of rational numbers:

[code]
BM1 BM2 BM3 BM4 BM5 BM6 BM7 BM8
Maximite 0.016 0.144 0.196 0.205 0.354 0.512 0.721 0.310

Maximite with line Nos 0.016 0.131 0.193 0.194 0.245 0.393 0.582 0.241
Maximite without line No 0.016 0.111 0.173 0.173 0.192 0.336 0.525 0.220
MicroMite 40MHz 0.028 0.18 0.285 0.289 0.644 0.892 1.346 0.376
MicroMite 48MHz 0.023 0.15 0.237 0.24 0.536 0.744 1.121 0.313

st429 180Mhz 0.012 0.073 0.117 0.125 0.207 0.315 0.497 0.162
st407 168Mhz 0.010 0.067 0.104 0.111 0.195 0.290 0.443 0.146

MX470 120MHz MMBasic 0.013 0.082 0.135 0.135 0.265 0.380 0.597
0.174
st7 200Mhz 0.005 0.041 0.06 0.065 0.11 0.161 0.254 0.103

Micromite EXTREME 198MHz 0.006 0.045 0.07 0.08 0.141 0.201 0.287 0.126

Arduino UNO 0.010 0.010 0.058 0.043 0.043 0.043 0.045 0.284
Arduino DUE 0.003 0.003 0.006 0.007 0.007 0.007 0.106 0.014

ESP32S NodeMCU module 0.00007 0.00007 0.00030 0.00011 0.00016 0.00016 0.00016 0.02413

[/code]

Here's the C code. If anyone spots anything I did wrong, I'll be happy to fix and rerun.
[code]
// ESP32 Benchmark; copy of twofingers Arduino Benchmark:
// https://www.thebackshed.com/forum/forum_posts.asp?TID=4685
// Compare to http://cpcwiki.eu/index.php/BASIC_Benchmark
// is working with UNO, MEGA and DUE
// No warranty, provided at your own risk.
// This sample may be freely distributed without charge
// twofingers at TBS 08-2014

const int BAUD_RATE = 9600, LOOPS=1000;
float j, a, m, blog, csin;
float ms,sum_ms;
int q;
float ray[5];

void G4000(void) {}

void setup() {
Serial.begin(BAUD_RATE);
}

void loop() {

Serial.println("Arduino Benchmark tests");
Serial.println(" ");
Serial.println("Benchmark 1");
ms = millis();
sum_ms=0;
for (j = 1; j <= LOOPS; j++)
{
}
Serial.println((millis() - ms) / 1000, 4);
sum_ms =+ millis() - ms,
delay(1000);

Serial.println("Benchmark 2");
ms = millis();
j = 0;
BM2:
j++;
if (j < LOOPS)
{
goto BM2;
}
Serial.println((millis() - ms) / 1000, 4);
sum_ms =+ millis() - ms;
delay(1000);

Serial.println("Benchmark 3");
ms = millis();
j = 0;
BM3:;
j++;
a = j / j * j + j - j;
if (j < LOOPS)
{
goto BM3;
}
Serial.println((millis() - ms) / 1000, 4);
sum_ms =+ millis() - ms;
delay(1000);

Serial.println("Benchmark 4");
ms = millis();
j = 0;
BM4:;
j++;
a = j / 2 * 3 + 4 - 5;
if (j < LOOPS)
{
goto BM4;
}
Serial.println((millis() - ms) / 1000, 4);
sum_ms =+ millis() - ms;
delay(1000);

Serial.println("Benchmark 5");
ms = millis();
j = 0;
BM5:;
j++;
m = j / 2 * 3 + 4 - 5;
G4000();
if (j < LOOPS)
{
goto BM5;
}
Serial.println((millis() - ms) / 1000, 4);
sum_ms =+ millis() - ms;
delay(1000);

Serial.println("Benchmark 6");
ms = millis();
j = 0;
BM6:;
j++;
m = j / 2 * 3 + 4 - 5;
G4000();
for (q = 1; q <= 5; q++)
{
}
if (j < LOOPS)
{
goto BM6;
}
Serial.println((millis() - ms) / 1000, 4);
sum_ms =+ millis() - ms;
delay(1000);

Serial.println("Benchmark 7");
ms = millis();
j = 0;
BM7:;
j++;
m = j / 2 * 3 + 4 - 5;
G4000();
for (q = 1; q <= 5; q++)
{
ray[q] = m;
}
if (j < LOOPS)
{
goto BM7;
}
Serial.println((millis() - ms) / 1000, 4);
sum_ms =+ millis() - ms;
delay(1000);

Serial.println("Benchmark 8");
ms = millis();
j = 0;
BM8:;
j++;
m = pow(j, 2);
blog = log(j);
csin = sin(j);
if (j < LOOPS)
{
goto BM8;
}
Serial.println((millis() - ms) / 1000, 4);
sum_ms =+ millis() - ms;
Serial.print("Avg: ");
Serial.println(sum_ms/8/1000,4);
Serial.println();
Serial.println("Arduino Benchmark");
Serial.println("F i n i s h e d !");
Serial.println();
while(1);
} [/code]
This is with the ESP32 module with wifi and bluetooth which I have been able to get for under $5 U.S. Now if it just ran MMBasic.Edited by lizby 2018-08-08