Tangentially related, some months ago I started a benchmarking project for 8-bit home micro BASIC systems, calculating prime numbers by trial division (the goal was not to have an efficient way of finding prime numbers, but to have some consistent unit of work that could be expressed simply and therefore be implementable regardless of limitations in any particular system's BASIC).
At some point I thought I'd try my hand at an APL version to compare the speeds of BASIC and APL in my IBM 5100, and the project started spiraling out of control from there.
ZBasic, Dartmouth True BASIC (on the Macintosh), various Microsoft BASICs, even Atari 2600 BASIC are all represented (that last one was a challenging port).
It's pretty clear to see that Microsoft BASICs were all pretty slow, that Woz's Integer BASIC is pretty tidy, and Acorn's BBC BASIC is a masterwork.
I still have a few more language ports up my sleeves in various unfinished stages, a structural mistake in the DRI Personal BASIC version (which has also snuck into a couple other ports) that causes it to do more work after finding the last prime, which I need to correct both in the source and the published results, and a long list of results to gather using software and hardware I've already collected with ports I've already written.
Mostly the micro results are in the bottom half.
http://www.typewritten.org/Articles/Benchmarks/primes.html
bear,
Thanks for your benchmark.
I ported the Commodore 64 program to my early 1980's Tektronix 4054A computer and got 21.27 seconds for n=100 last night:
Code:
Benchmark PRIMES
Start: 04-JAN-20 09:47:03.97 PM
End: 09:47:27.11 PM
Benchmark PRIMES (secs)= 21.27
END
The Tektronix 4052A and 4054A computers were the last generation of a series started in 1975 with the 4051 using a 6800 CPU running at 833KHz.
http://w140.com/tekwiki/wiki/4051
These computers were designed for scientific and engineering markets with remarkable graphics resolution of 1024x780 on the 4051 in 1975 based on Tektronix storage tube technology using vectors.
The 4051 entry price was $5995 with 32KB of BASIC ROM and 8KB of DRAM. Memory could be upgraded to a max of 32KB of DRAM.
The 4052 and 4054 were introduced in the late '70's to support demand for higher performance, and were a custom AMD 2901 bit-slice design with a 16-bit data bus, 128KB of total memory, with over 64KB of BASIC ROM and up to 64KB of DRAM. This architecture also provided 6800 8-bit instructions with new opcodes including
micro-coded floating point instructions.
These hardware floating point instructions showed great performance (for the '80s) in the prime results above.
The 4052 and 4054 bit-slice microcoded CPU clock rate was 25MHz.
The 4052 had the same 12" Tektronix flat storage CRT and resolution as the 4051.
The 4054 and 4054A had a Tektronix 19" storage tube like the Tektronix 4114 terminal with 4096x3072 resolution! Still state of the art today :D
The 4052A and 4054A were introduced in the early 1980's, and the series was discontinued in the late 1980's.
The A-series added structured BASIC commands and other firmware enhancements including an assembly language CALL "EXEC", along with an assembler and documentation for the microcode instruction set and BASIC ROM entry points.
Here is my port of your prime program in Tektronix 4050 BASIC.
I have a Transera Real Time Clock ROMPACK plugged into the 4054A that provided the timing in HH,MM,SS,and hundredths of a second in a single CALL "!TIME" with numeric output parameters.
Tek BASIC arrays do not support a ZERO index, so I adjusted the program accordingly.
Also I created this one after typing in the nine BM benchmarks, which I will show results in a separate post. I changed the A variable to X in your prime program.
The output for the benchmark timing used separate 4800 baud serial printout to a laptop computer.
The serial port is accessed with the PRINT @40: statements. These Tektronix computers had optional serial interfaces and embedded GPIB interfaces. The @#: syntax allowed PRINT, READ, WRITE and byte commands to be addressed to any GPIB device or serial device.
I printed each computed prime to the screen during the benchmark - to match the other computers.
The formatted start/end printing and serial printing is outside the benchmark time measurement, which is why the total start/end time is slightly longer than the run.
Code:
1 GOSUB 900
2 CALL "!TIME",A0,B0,C0,D0
3 GO TO 10
5 X=X+1
6 GO TO 50
10 DIM P(100)
15 P=0
20 P(1)=2
25 PRINT P(1)
30 X=3
40 FOR F=2 TO 100
50 FOR I=1 TO F-1
60 V=X/P(I)
65 IF V=INT(V) THEN 5
70 NEXT I
80 PRINT X;
90 P(F)=X
100 X=X+1
110 NEXT F
120 CALL "!TIME",A1,B1,C1,D1
130 GO TO 1010
900 REM PRIMES
910 C$="PRIMES"
920 CALL "!DATETIME",A$
930 PRINT "Benchmark ";C$;"Start: ";A$
940 PRINT @40:"Benchmark ";C$
950 PRINT @40:"Start: ";A$
960 RETURN
1010 CALL "!TIME",B$
1020 PRINT "End: ";B$
1030 PRINT @40:"End: ";B$
1040 S0=A0*3600+B0*60+C0+D0/100
1050 S1=A1*3600+B1*60+C1+D1/100
1060 S=S1-S0
1070 PRINT "Benchmark ";C$;"(secs)= ";S
1080 PRINT @40:"Benchmark ";C$;" (secs)= ";S
1090 PRINT "END"
1100 PRINT @40:"END"
1110 END
1120 RETURN