Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 22:50 03 Jul 2020 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : BASIC Speed Benchmark Tests

     Page 3 of 3    
Author Message
isochronic
Guru

Joined: 21/01/2012
Location: Australia
Posts: 689
Posted: 09:43am 23 Nov 2016
Copy link to clipboard 
Print this post

The MZ EF pipelining is optimised for 32-bit instead of
the 64-bit double precision. A 32-bit MZ EF MMBasic would be even faster
I think. [Presumably the ST test would be a fair bit slower using dp ? maybe the
ST7 FPU is only single precision]Edited by chronic 2016-11-24
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2781
Posted: 10:03am 23 Nov 2016
Copy link to clipboard 
Print this post

Can anyone tell me the current consumption of the 'basic' ST7 (compared to 135mA for the Extreme).

By the way - has the 'MM Extreme' name been 'approved' by Geoff? We seem to have adopted it here on TBS so am just wondering . . . . I think it is a good name! OR 'MicroMite Harmony' maybe (sorry kiiid)
For everything Micromite visit micromite.org

Direct Email: whitewizzard@micromite.o
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2781
Posted: 10:10am 23 Nov 2016
Copy link to clipboard 
Print this post

@matherp

If you understand how the MZ can run at 252MHz (as kiiid indicates), could you re-post those timings!!
Would be interesting to see how they then compare to the ST7.

And if you do have it clocked at 252MHz, can I please ask my usual question regarding current consumption Thanks!
For everything Micromite visit micromite.org

Direct Email: whitewizzard@micromite.o
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 3387
Posted: 12:13pm 23 Nov 2016
Copy link to clipboard 
Print this post

  Quote  f you understand how the MZ can run at 252MHz


The current MZ processors are limited to 200Mhz - anything greater is overclocking. The next range (NOT YET ANNOUNCED) may well be faster
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2781
Posted: 12:20pm 23 Nov 2016
Copy link to clipboard 
Print this post

  Quote   The next range (NOT YET ANNOUNCED) may well be faster


Come on, we're running out of names So how long before the MM NYA?
For everything Micromite visit micromite.org

Direct Email: whitewizzard@micromite.o
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 08:17pm 23 Nov 2016
Copy link to clipboard 
Print this post

  WhiteWizzard said  
  Quote   The next range (NOT YET ANNOUNCED) may well be faster


Come on, we're running out of names So how long before the MM NYA?

Micromite Ludicrous. :)

Microblocks. Build with logic.
 
Tinine
Guru

Joined: 30/03/2016
Location: United Kingdom
Posts: 366
Posted: 04:25am 01 Jan 2017
Copy link to clipboard 
Print this post

Happy New Year to all!


Just for giggles, I ran a similar BM on the ByPic which runs, interactively on the PIC32MX170 @40MHz. Not pure BASIC, though, so I had to adapt.

BM1: 0.001
BM2: 0.010
BM3: 0.023
BM4: 0.020
BM5: 0.027
BM6: 0.041
BM7: 0.080
BM8: 0.043



//ByPic Benchmark tests
//PIC32MX170 @40MHz

// No GOTO available so substituted a do-until
// No GOSUB available so substituted a function call "fourthou()" for "Gosub 4000"

// Created separate functions for each BM

dim j, timer, a, l#, s#, q

function bm1()
print "Benchmark 1\n"
j=0
timer = tick()

for j = 1 to 1000
next

print tick()-timer
endf
// Total execution time: 0.000968 (<1ms)

function bm2()
print "Benchmark 2\n"
j=0
timer = tick()

do
j=j+1
until j=1000

print tick()-timer
endf
// Total execution time: 0.0093 (<10ms)

function bm3()
print "Benchmark 3\n"
j=0
timer = tick()

do
j=j+1
a = j/j*j+j-j
until j=1000

print tick()-timer
endf
// Total execution time: 0.0231 (~23ms)

function bm4()
print "Benchmark 4\n"
j=0
timer = tick()

do
j=j+1
a = j/2*3+4-5
until j=1000

print tick()-timer
endf
// Total execution time: 0.0198 (<20ms)

function fourthou()
return 6
endf

function bm5()
print "Benchmark 5\n"
j=0
timer = tick()

do
j=j+1
a = fourthou()
a = j/2*3+4-5
until j=1000

print tick()-timer
endf
// Total execution time: 0.0273 (<28ms)

function bm6()
print "Benchmark 6\n"
j=0
timer = tick()

do
j=j+1
a = fourthou()
a = j/2*3+4-5
for q = 1 to 5
next
until j=1000

print tick()-timer
endf
// Total execution time: 0.0409 (~41ms)


function bm7()
print "Benchmark 7\n"
j=0
timer = tick()
dim ray2(6)
do
j=j+1
a = fourthou()
a = j/2*3+4-5
for q = 1 to 5
ray2(q) = a
next
until j=1000

print tick()-timer
endf
// Total execution time: 0.0803 (~80ms)

function bm8()
print "Benchmark 8\n"
j=0
timer = tick()

do
j=j+1
a = j^2
l# = log(j)
s# = sin(j)
until j=1000

print tick()-timer
endf
// Total execution time: 0.0432 (~43ms)
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 722
Posted: 06:28pm 06 Aug 2018
Copy link to clipboard 
Print this post

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
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 2016
Posted: 12:32pm 08 Aug 2018
Copy link to clipboard 
Print this post

  lizby said   ESP32 C benchmark.


Maybe test a BASIC that runs on the ESP32.

Did you prevent the C compiler from doing optimisations? (And preferably also check the code to see it has done so?)

I'm not actually sure the point of running the C versions, especially without doing them for other chips (RPi, ST429 etc) as it's not news that compiled C runs a lot faster than interpreted Basic :)

(Bear in mind there is no chance to run MBasic on the Arduino so C was about the only option.)

  lizby said   Now if it just ran MMBasic.


Get the source code and change it if that's what you want :)

JohnEdited by JohnS 2018-08-09
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 722
Posted: 12:49pm 08 Aug 2018
Copy link to clipboard 
Print this post

  JohnS said  Get the source code and change it if that's what you want :)


Sure, sure, just like snapping my fingers.
Edited by lizby 2018-08-09
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 3387
Posted: 01:25pm 08 Aug 2018
Copy link to clipboard 
Print this post

There is nothing I can see to stop MMBasic running on the ESP32 it is just 2 or 3 hundred hours of slog work to make it happen. Then you have to consider the development environments- Arduino: c..p, native: unknown quantityEdited by matherp 2018-08-09
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 2016
Posted: 03:19pm 08 Aug 2018
Copy link to clipboard 
Print this post

  lizby said  
  JohnS said  Get the source code and change it if that's what you want :)


Sure, sure, just like snapping my fingers.

Not at all - but who else is going to do it? And - bearing in mind the other choices - why?

John
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 328
Posted: 09:04pm 30 Jan 2020
Copy link to clipboard 
Print this post

Just for the fun of it, i typed in the benchmark program in RiscOS BBC basic on the pi zero.
To get comprehensive timer values i ran each test 1000000 times.
Here are the results.

Bm1 : 0.0016
Bm2 : 0.0063
Bm3 : 0.0159
Bm4 : 0.0134
Bm5 : 0.0150
Bm6 : 0.0291
Bm7 : 0.0292
Bm8 : 0.0357

Roughly 10x as fast as a maximite
Edited 2020-01-31 07:10 by Volhout
If nothing goes right ... turn left
 
     Page 3 of 3    
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2020