Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 19:56 15 Nov 2025 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 : Ahl's simple benchmark

Author Message
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 1637
Posted: 05:18pm 13 Nov 2025
Copy link to clipboard 
Print this post

timer=0
for n=1 to 100 : a = n
for i=1 to 10
a=sqr(a):r=r+rnd(1)
next i
for i=1 to 10
a=a^2: r=r+rnd(1)
next i
s=s+a: next n
print abs(1010-s/5)
print abs(1000-r)
print timer






Interesting to compare the PicoMite with the IBM PC compiled BASIC.

Cray-1 appears to be ~5 X faster than PicoMite  
 
jwettroth

Regular Member

Joined: 02/08/2011
Location: United States
Posts: 80
Posted: 05:59pm 13 Nov 2025
Copy link to clipboard 
Print this post

On MMBasic for DOS on 5 yr old I7 Desktop (3.3GHz IIRC)- I get the following-

6.821...e-13
6.696...
0

Do these values make sense?  I guess the timer never got to make a tick.  

Does this mean I'm 10^6x faster than a Cray!

Good fun- love this old stuff that compares Osborne's to Cray's.
Edited 2025-11-14 04:09 by jwettroth
John Wettroth
 
toml_12953
Guru

Joined: 13/02/2015
Location: United States
Posts: 477
Posted: 06:08pm 13 Nov 2025
Copy link to clipboard 
Print this post

  PhenixRising said  
timer=0
for n=1 to 100 : a = n
for i=1 to 10
a=sqr(a):r=r+rnd(1)
next i
for i=1 to 10
a=a^2: r=r+rnd(1)
next i
s=s+a: next n
print abs(1010-s/5)
print abs(1000-r)
print timer



Interesting to compare the PicoMite with the IBM PC compiled BASIC.

Cray-1 appears to be ~5 X faster than PicoMite  


On a PicoCalc running WebMite 6.01.00 RC12 on a Pico 2W @ 252000 Hz, I get a runtime of 0.07 seconds. That makes it third in the list of computers right after the Amdahl. Amazing for a handheld!
Edited 2025-11-14 04:09 by toml_12953
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5464
Posted: 07:45pm 13 Nov 2025
Copy link to clipboard 
Print this post

  jwettroth said  On MMBasic for DOS on 5 yr old I7 Desktop (3.3GHz IIRC)-
I guess the timer never got to make a tick.  


The timer in an IBM PC is not a ms timer. Not sure what Geoff uses, but it used to be a 16ms tick (60Hz video).

On an i5 running MMB4L, I get 9ms (just a bit faster that the Cray-1).
May be that the Cray-1 ran compiled code. Maybe Fortran.

But it feels a bit like comparing home computers from the 80's to 60's mainframes.

Volhout
Edited 2025-11-14 05:46 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Sasquatch

Guru

Joined: 08/05/2020
Location: United States
Posts: 378
Posted: 09:11pm 13 Nov 2025
Copy link to clipboard 
Print this post

Ahhh...Yes!  Lots of "Memories" on that there list!

It's also interesting that you can identify the version of basic by the "Accuracy" numbers.  For example the Vic20, C64, AppleII and a few others all used a version of Microsoft Basic for 6502 with 40bit floating point (32bit mantissa + 8bit exponent)
-Carl
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5464
Posted: 07:59am 14 Nov 2025
Copy link to clipboard 
Print this post

Phenix,

The only thing I do not understand is the random column.
You count up 1000 x 2 random numbers (between 0 and 1) and subtract 1000. But if it is true random 2000 numbers would not do it. AFAIK this number says nothing. On a RP2040 (that according to Peter has a true random generator) I get responses varying between 0 and 30 at successive runs.

And that is the only thing that makes sense. In case you see the same response twice, you know it is not true random, but running a fixed algoritm. But then you need multiple values in the column Random. I know the ORIC 1 / ATMOS had such. Each run the sequence of random numbers would be the same.

Volhout
PicomiteVGA PETSCII ROBOTS
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1148
Posted: 06:04pm 14 Nov 2025
Copy link to clipboard 
Print this post

The random numbers should be uniformly distributed over the range of (0,1]
So the average should be 0.5
This is statistics, of course, so the larger the sample size, the better the average should be.
Visit Vegipete's *Mite Library for cool programs.
 
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 1637
Posted: 09:42pm 14 Nov 2025
Copy link to clipboard 
Print this post

My limited understanding of this stuff simply had me wondering why we are expecting something consistent out of something "random".

 
toml_12953
Guru

Joined: 13/02/2015
Location: United States
Posts: 477
Posted: 10:33pm 14 Nov 2025
Copy link to clipboard 
Print this post

  vegipete said  The random numbers should be uniformly distributed over the range of (0,1]
So the average should be 0.5
This is statistics, of course, so the larger the sample size, the better the average should be.


In most BASICs, the distribution is [0,1)
0 is included but 1 isn't.
 
Print this page


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

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025