Site icon xiphod

Exploring Project Ahl in 2024

Advertisements

Some time ago, I came across an old Computer World article from 1980 that was comparing “$15,000 computers” (high end equipment at the time). That discussion is here. And the point of those articles was showing how some of the then-new-to-the-world microcomputers were seemingly catching up with the performance of those “high end” machines, at substantially less cost.

I then came across an article describing a kind of “performance benchmark” that had been implemented in BASIC, first introduced in 1983 in Creative Computing (see here November 1983 edition, page 260), and known as Ahl’s Benchmark since the code was submitted by David Ahl.

A have a number of “boots-up-to-BASIC” systems around, so I thought it would be interesting to run this same benchmark on those systems, and compare some 2024-results with those 1983-results. Listed below is the version of the Ahl-Benchmark code as I used it. A summary of my changes are:

20 FOR N=1 TO 100
25 A=N
30 FOR I=1 TO 10
40 A=SQR(A)
45 R=R+RND(1)
50 NEXT I
60 FOR I=1 TO 10
70 A=A^2
75 R=R+RND(1)
80 NEXT I
90 S=S+A
95 NEXT N
100 PRINT ABS(1010-S/5)
110 PRINT ABS(1000-R)

The original Creative Computing article describes the working of the benchmark program (and also discloses known limitations and issues about it). No single benchmark is ever perfect, but I wanted to just stick with this original as-is to give it a try. For the benchmark results, essentially the first number is a measure of the “accuracy” of the floating point (such that closer to 0 is better, this number will not change between runs). The second number is a measure of the “quality of randomness” and would also ideally be 0 (so again, lower is better, but the number will vary and so a few runs is necessary to see the typical trend).

Float AccuracyRandomnessTime (MM:SS.ms)
HP 9830A (1973)8.89000E-061.310201:51.85
IBM 5100 (1975)1.566E-6782.32694003:04.32
IBM 5110 (1978)3.458354E-10
1.447754 (single)
954.616583
954.5898
00:40.38
00:38.12
HP 85 (1980)0.00000002 (2.0E-8)993.98262601401:19.098
Commander X16 (8MHz 65C02) (2024)5.65648079E-41.26747227 (best)
22.1375535 (worse)
00:07.75
Commodore 64
(stock 1MHz) (1982)
1.04141235E-31.15579295 (best)
13.7690766 (worst)
02:02.39
Tandy Color Computer 3 (6309 upgraded) (1986)3.96284867E-45.856625802:22.48
IBM 5150 (4.77MHz stock) (1983)1.159668E-29.31750500:23.88
Commodore PET (4032 from 1980)1.04141235E-37.3232705602:00.12
NEC PC-8001 mk II (1983)0.03387451.7639201:28.14
Tandy Model 102 (1986)2.058E-712.494425927604:55.84
Apple IIe (1986 Platinum)1.04141235E-30.82174301101:53.71
Sharp PC-5000 (1983)5.859375E-37.18841600:29.75
NEC PC-8001 (1979)0.03387451.7639201:30.72
Aquarius+ (2024)0.1878051.2034301:11.34
Agon Lite 2 (2023)
(bbcbasic 1.06)
2.57968903E-43.2627253500:01.31

Here is a text-code version of the same data:

Some concluding notes and observations:

The runtime here corresponds to that systems’ ability to tokenize the BASIC program, then interpret the tokens during the runtime of the program. Some systems will tokenize as the program is being entered (and typically on those systems, the BASIC program is reformatted when it is LISTed such that it differs from what was originally typed in). As an example of tokenizing, a keyword such as “SQR” or action such as * (multiply) is encoded into a byte, and variables (such as R and S) are allocated to a storage spot in the BASIC “workspace” (in most BASIC’s that reserved space is 5 bytes for each declared variable).

Some systems are obviously more efficient in their implementation of BASIC than others. Another factor on the runtime is the implementation of the SQR and RND function, which can vary widely across the systems. The RND call in particular might use a clock-related counter or may rely on some algorithm techniques (which those techniques may be both slower and less random). The presence of any clock requires some custom machine code to access (wrapped in the System ROM’s implementation of BASIC for that system), but the clock (or counter) can be thought of as a “hardware-accelerated” random number generator.


SPECIAL: HP9830A and Ahl’s Benchmark

Using GO9800 emulator, determined the following is syntax valid for the HP9830A. Some interesting notes:

Results (in GO9800 emulator) were displayed in 8.83 seconds, with decent benchmark results. We’ll see how the real hardware compares.

On the real hardware, the results were like this:

Exit mobile version