Earlier this year, on the fediverse, @electron_greg posted a short portable Basic program and started collecting timings for various retro machines. But his account is now gone! Fortunately, the computer museum NAM-IP has reconstructed the results, here.
Just in case it’s again lost, here are some quotes:
This is a repost of benchmark of BASIC on various micro proposed by Electron Greg earlier in 2026 but which looks not reachable any more. So we don’t loose that interesting information !
BASIC code is based on the SPIGOT algorithm implementing a continuous base change, see this PDF by Valentin Albillo
SPIGOT – Producing Digits of π one at a timeQuite generic BASIC code (but may require some tuning)
1 N=20: L=INT(10*N/3): DIM A(255): Z$="000000":T$="999999"
2 FOR I=1 TO L: A(I)=2: NEXT I: M=0: P=0: FOR J=1 TO N: Q=0: K=2*L+1
3 FOR I=L TO 1 STEP -1: K=K-2: X=10*A(I)+Q*I: Q=INT(X/K): A(I)=X-Q*K: NEXT I
4 Y =INT(Q/10): A(1)=Q-10*Y: Q=Y: IF Q=9 THEN LET M=M+1: GOTO 7
5 IF Q=10 THEN PRINT STR$(P+1);LEFT$(Z$,M);: P=0: M=0: GOTO 7
6 PRINT STR$(P);LEFT$(T$,M);: P=Q: M=0
7 NEXT J:PRINT STR$(P)
Ranking by increasing time to compute, number without credit are by Greg
RC2014 : 14 (thank you JonV)
BBCMicro : 19
AmstradCPC : 22 (thank you Devlin)
AmstradPCW : 23 (thank you Pete)
AcornElectron : 25
C128 : 27 (fast mode - thank you Jonas H)
LuxorABC80 : 29 (thank you Erik)
SharpMZ700 : 32 (thank you Tim Holyoake)
DAI: 33 (by NAM-IP)
VIC20 : 36
AcornAtom : 37
AppleII : 38 (thank you Jeroen)
TRS80CoCo : 42 (thank you Chip)
Atari800 : 42 (thank you Mark Elliott)
CBMPET : 43
C64 : 43
Dragon32 : 44
SharpMZ80K : 45 (thank you Tim Holyoake)
C16 : 46
Altair8800 : 52
MSX : 53 (thank you Pixel Purrito)
C128 : 56 (default “mode”)
ZX80 : 57
ZXSpectrum : 68 (thank you Adam)
SharpPC1500A : 167 (thank you Karttu)
SharpPC1245 : 405 (thank you Karttu)Our contribution for our Belgian DAI computing 20 PI digits in about 33s
There are also traces of various replies to the original thread, lying around in a detached state…
Here’s one from Tim Holyoake (psychotimmy) which includes an alternative, a primes benchmark.
Here’s an algorithmic clarification from Jeroen Wiert Pluimers, which links to a post of mine where I note
It’s nice to observe that this pi spigot algorithm dates from 1991 - later than most of these micros. Introduced by Rabinowitz as 14 lines of Fortran, and four years later explained in a paper with Wagon.
By 1994 Dik Winter had written his 133-character C version, according to this Usenet thread.
Somewhere nearby, I noted that the point of the basic Basic benchmark was to benchmark various Basics. It wasn’t an invitation to improve the coding or the algorithm or to make something faster but not so portable. But I linked to the Stardot thread “Calculating digits of Pi in Basic” and said:
The best BBC Basic effort I could come up with is towards the end of that thread, producing the requested 20 digits in 2.07 seconds.
I also chose to have a look at how fast a very BBC Basic version of the original algorithm could run on a Beeb. I did that here:
For what it’s worth (very little!) here’s that 8.11 second version in (very) BBC Basic:
0 T%=TIME
1 N%=20: L%=10*N%/3: DIM A%(255): Z$="000000":T$="999999"
2 FORI%=1TOL%:A%(I%)=2:NEXT: M%=0:P%=0:FORJ%=1TON%:Q%=0:K%=2*L%+1
3 FORI%=L%TO1STEP-1:K%=K%-2:X%=A%(I%)*&A+I%*Q%:Q%=X%DIVK%:A%(I%)=X%-K%*Q%:NEXT:Y%=Q%DIV&A:A%(1)=Q%-Y%*&A:Q%=Y%:IFQ%<9PRINT;P%LEFT$(T$,M%);:P%=Q%:M%=0:NEXTELSEIFQ%=9M%=M%+1:NEXTELSEPRINT;P%+1LEFT$(Z$,M%);:P%=0:M%=0:NEXT
4 PRINT;P%:PRINT (TIME-T%)/100;" seconds"
