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 8 | |||||
Author | Message | ||||
isochronic Guru Joined: 21/01/2012 Location: AustraliaPosts: 689 |
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] |
||||
WhiteWizzard Guru Joined: 05/04/2013 Location: United KingdomPosts: 2817 |
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 KingdomPosts: 2817 |
@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 KingdomPosts: 9105 |
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 KingdomPosts: 2817 |
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: ThailandPosts: 2209 |
Micromite Ludicrous. :) Microblocks. Build with logic. |
||||
Tinine Guru Joined: 30/03/2016 Location: United KingdomPosts: 1646 |
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 StatesPosts: 3150 |
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. PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 3800 |
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.) Get the source code and change it if that's what you want :) John |
||||
lizby Guru Joined: 17/05/2016 Location: United StatesPosts: 3150 |
Sure, sure, just like snapping my fingers. PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 9105 |
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 quantity |
||||
JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 3800 |
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: NetherlandsPosts: 4222 |
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 PicomiteVGA PETSCII ROBOTS |
||||
twofingers Guru Joined: 02/06/2014 Location: GermanyPosts: 1240 |
CMM2 (400 MHz) just for fun and completeness: Bm1 : 0.0022 Bm2 : 0.0205 Bm3 : 0.0333 Bm4 : 0.0378 Bm5 : 0.0644 Bm6 : 0.0887 Bm7 : 0.1293 Bm8 : 0.0604 Nearly the speed of a Arduino UNO running "C". causality ≠correlation ≠coincidence |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 9105 |
CMM2 (480MHz) using latest V5.05.04RC12 firmware Bm1 : 0.0016 Bm2 : 0.0151 Bm3 : 0.0241 Bm4 : 0.0280 Bm5 : 0.0502 Bm6 : 0.0689 Bm7 : 0.0966 Bm8 : 0.0456 |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 9105 |
CMM2 (400MHz) using latest V5.05.06RC11 firmware with the GOSUB entry point changed to a label rather than a line number - Don't ever use line numbers on the CMM2 if you want performance Bm1 : 0.00073 compared to Maximite 1: 21.8x Bm2 : 0.01534 compared to Maximite 1: 7.2x Bm3 : 0.02288 compared to Maximite 1: 7.5x Bm4 : 0.02583 compared to Maximite 1: 6.7x Bm5 : 0.02822 compared to Maximite 1: 6.8x Bm6 : 0.04109 compared to Maximite 1: 8.1x Bm7 : 0.06813 compared to Maximite 1: 7.7x Bm8 : 0.03327 compared to Maximite 1: 6.6x CPU clock ratio 5.0x |
||||
twofingers Guru Joined: 02/06/2014 Location: GermanyPosts: 1240 |
Hi Peter, good job! I think we should maybe have our own, more comprehensive benchmark that also includes string + memory handling, graphics, and more. With this we could measure whether optimizations achieve something. Michael causality ≠correlation ≠coincidence |
||||
ChrisJournoud Newbie Joined: 12/10/2020 Location: FrancePosts: 20 |
It could be interesting on a device like this : https://fr.aliexpress.com/item/33014937190.html?spm=a2g0o.cart.0.0.45523c00WhKTHm&mp=1 Sadly i have not the knowlegge neither the skills to do the port Edited 2020-11-02 23:10 by ChrisJournoud |
||||
toml_12953 Guru Joined: 13/02/2015 Location: United StatesPosts: 339 |
the electrons are probably frozen in the US and running slower. Nope, it's now 32 deg. here in May and still slower. |
||||
Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 6778 |
Benchmarks have been quoted ever since computers started - and they still don't mean much. It used to be a skill, writing benchmarks that made a particular computer look better than anyone else's. :) At best they give a *very rough* guide. String handling: don't run into garbage collection on an old computer or the result is meaningless, even on that machine. Unless you are testing for the efficiency of garbage collection, of course. :) Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
Page 3 of 8 |
Print this page |