Rugg/Feldman benchmarks

The Rugg/Feldman benchmarks are a series of seven short BASIC programming language programs that are used to test the performance of BASIC implementations on various microcomputers. They were published by Tom Rugg and Phil Feldman in the June 1977 issue of the US computer magazine, Kilobaud.

The article reported that Integer BASIC, an interpreter program written by Steve Wozniak for the Apple II computer, was much faster than the other programs tested. This sparked widespread comments about the tests, including a lengthy letter from Bill Gates. A follow-up article in the October 1977 issue addressed these concerns in depth and added many new machines and BASICs to the set of results.

John Coll added an eighth test using transcendental functions in an article in the February 1978 issue of the British magazine Personal Computer World (PCW). This expanded set became known as the PCW Benchmarks, and was particularly popular as a test for UK-designed machines like the Grundy NewBrain and BBC Micro.

The benchmark was widely used through the late 1970s, and appears as a standard in many computer magazines and journals. In the 1980s it was not as widely used in the US as the Creative Computing Benchmark or Byte Sieve, but remained in common use in the UK.

First tests
The benchmark suite was introduced to test claims that were being made by vendors that their BASIC was much faster than others running on the same machines. The authors were unable to find a set of standardized benchmarks and decided to write their own. The tests deliberately ignored string and floating point performance, as many BASICs of the era, especially those descended from Tiny BASIC, lacked these features. Strings were further hindered by major differences in syntax between different versions.

The two ran the benchmarks on every machine they could find, typically at friends' houses. All of the major 8-bit CPUs were tested, including the Intel 8080, Zilog Z80, Motorola 6800 and MOS 6502. For comparison, they also ran it on a CDC Cyber 174 supercomputer, which is so fast that they had to add code to time the run using the system's clock as they could not operate a stopwatch quickly enough. They used this machine for two reasons; one was simply to see how fast such a machine ran, and the other was to ensure no one micro would end up at the top of the list and then claim they had been proven to be the fastest.

The article makes a special note of the BASIC that shipped with IMSAI computers, as it basically didn't work. The machine was very new at the time and the BASIC was described by the company as "preliminary". During this period, different IMSAI machines were delivered with different versions of BASIC. Each version had different features, but none of them were able to run even the majority of the programs.

The Apple II, using the original Integer BASIC, finished well in front of all the other machines. As the tests did not make use of any floating point features, this result was not surprising given the much simpler internal representation of numbers. The next fastest, albeit significantly slower, was Zapple BASIC on a Zilog Z80 add-in card in an Altair 8800. The rest of the list contained a number of very closely spaced entries, dominated by what would later be known as Microsoft BASIC. Across the entire suite of 8080 and Z80 machines and versions of BASICs, the spread was only 20%. In contrast, the 6800-based machines were isolated entirely at the bottom of the list, 30 to 40% slower than the 8080 and Z80 entries.

As the article went to press, the editors of Kilobaud visited several local computer stores to test the programs on newer machines. This process added the production version of IMSAI BASIC, North Star BASIC and the 11 kB BASIC on the Poly-88. IMSAI's results were at the bottom of the pack, while North Star and Poly were in the middle.

Follow-up
Rugg and Feldman revisited the suite in the October 1977 issue. The new article opened by noting they had been deluged with mail about the original article. Among them was a letter from Bill Gates, who they introduce as the author of "Altair BASIC (8080 and 6800 versions), OSI BASIC and PET BASIC". The last entry refers to a member of the "1977 trinity" of machines, the Commodore PET, which was made available in prototype form for inclusion in the article.

Gates complained that the original test series "let an integer BASIC be compared against... more powerful BASIC... using floating point." He suggested that the test include a  at the start, which would make newer versions of Altair BASIC use integer math as well. Instead, Rugg and Feldman took another approach and eliminated all integer-only BASICs from the new test results. This did not eliminate the Apple II, which by this time had introduced the MS-derived Applesoft BASIC on cassette.

Gates also noted that the results for the 6800 machine were not indicative of this processor. The machine they used, the Altair 680, runs the CPU at half its rated speed. He suggested a more typical 6800-based machine would be slightly faster than the 8080. However, the 6800 once again put in a poor showing even on newer machines running at higher speeds.

Gates also suggested that the Cyber 173's time was likely due to it being a compiler rather than an interpreter. The authors point out this was not the case for the TRW BASIC they used in the original test, and then use this as a segue to compare the differences between compilers and interpreters.

Gates concluded his letter by noting that a number of the results were identical in spite of being on different machines. He suggests this is because the BASICs in question contained "signatures" from Altair BASIC and are thus "illegitimate software". He did not specify which ones he claimed were stolen, and the authors responded by saying that if "Bill can stop people from selling them through legal means, we'll stop listing them."

Rugg and Feldman conclude the article by mentioning some of the other concerns that were raised after the original article. One common issue was the lack of more advanced mathematical functions, which they acknowledge, but suggest this is something best left to the reader. The other was the lack of string manipulation, but they note that the syntax of string handling differed considerably between platforms and thus could not be made in a single version.

In this series of tests, the list was topped by the OSI Challenger, a 6502-based machine that had been "souped up" to 2 MHz, double that of typical 1 MHz 6502 machines of the era like the Apple II and PET. When running at its normal 1 MHz speed, the Challenger was just beaten by Zapple BASIC on Z80 machines running at 4 MHz. PET BASIC was next, only slightly behind the Challenger. They conclude that the 6502 is the highest performing of the CPUs, agreeing with comments Gates had made in his letter. The 6800 once again ends up in last place.

PCW version
As part of a longer article discussing new entries into the computer market, including the TRS-80, John Coll used the Rugg/Feldman tests to benchmark a variety of machines available to him in the UK in October 1977. He added an eighth test to exercise the math routines, and provided the resulting run times both on their own as well as the additional time compared to Test 7, in keeping with the earlier concept of each test modifying the last. The results were published in the first issue of Personal Computer World in February 1978, with a short follow-up in their November 1978 issue.

Use
As one of the earliest sets of BASIC benchmarks, the F/R tests were seen primarily in the late 1970s and early 1980s. It was a standard among reviews in Kilobaud, used to compare the many new varieties of BASIC that continued to appear for early microcomputers. Compute! used it for their 1979 review of the Challenger 1P, and 68 Journal used it to demonstrate the extremely high performance of BASIC09. InfoWorld used it for their 1981 review of a new BASIC for the TRS-80, and the TRS-80 Color Computer as a whole.

After that point the Byte Sieve began to become popular and the number of articles referring to the F-R benchmark become less common, but it could be found even such rarefied sources as the HP Journal.

The PCW versions remained very popular in the UK, and can be found in many reviews of UK-centric machines like the Grundy NewBrain, various Sinclair Research machines, and the BBC Micro.

Programs
The programs were designed to allow a user to type in the first test, run it, and then modify it in-place to run the subsequent tests. This meant the user did not have to type in seven different programs, but simply modify a single one. The first seven listings are the originals from the 1977 article, the eighth is the PCW addition.

Benchmark 1
300 PRINT"S" 400 FOR K=1 TO 1000 500 NEXT K 700 PRINT"E" 800 END

FOR-NEXT loops are one of the most fundamental constructs in the BASIC language, and if the performance of these loops is slow it is highly likely that any program running in that BASIC will be slow as well. A famous example of this is Atari BASIC, which had several problems that greatly slowed the performance of FOR-NEXT loops compared to contemporary examples, and BASIC programs on the Atari were generally very slow as a result.

Benchmark 2
300 PRINT"S" 400 K=0 500 K=K+1 600 IF K<1000 THEN 500 700 PRINT"E" 800 END

This test ultimately performs the same operations as test 1, but in this case, it uses an explicit test and jump rather than using the built-in FOR-NEXT construct. Generally, this program runs much slower than 1 because most BASICs parse the parameters in the FOR, including the line number, only once when it is first encountered. Using the IF, as in test 1, causes it to parse the values every time through the loop. Moreover, most BASICs do not simply store the parsed line number of the top of the loop, but the memory address, whereas a THEN requires the interpreter to scan through the program for the corresponding line number, in this case. Although this test does not show it due to its small size, this search takes increasingly long times as the program length grows. Some versions of BASIC optimized GOTO using explicit labels, or pushing the GOTO targets on a stack to make them perform like NEXT. Turbo-Basic XL did both, and ran much faster than any similar BASIC as a result.

Benchmark 3
300 PRINT"S" 400 K=0 500 K=K+1 510 LET A=K/K*K+K-K 600 IF K<1000 THEN 500 700 PRINT"E" 800 END

Test 3 is an expansion of test 2, this time adding some basic mathematics and variable access. By comparing the time to run tests 2 and 3, one can get an idea of the performance of the language's math library.

Benchmark 4
300 PRINT"S" 400 K=0 500 K=K+1 510 LET A=K/2*3+4-5 600 IF K<1000 THEN 500 700 PRINT"E" 800 END

The same as test 3 except that the variable  is replaced by numeric constants. This requires the interpreter to convert the values from their textual representation into their internal storage format, which takes time (unless this is performed once and for all, before execution, as in some more advanced BASICs). Some idea of the performance of this conversion functionality can be determined by comparing this time to benchmark 3.

Benchmark 5
300 PRINT"S" 400 K=0 500 K=K+1 510 LET A=K/2*3+4-5 520 GOSUB 820 600 IF K<1000 THEN 500 700 PRINT"E" 800 END 820 RETURN

Test 5 introduces a subroutine call. Long programs in early versions of BASIC would make extensive use of subroutines and thus the efficiency of the calling mechanism was important. Depending on the way the system worked, the return might cache the location of the calling line in a fashion similar to NEXT, and thus run very quickly. Others might store the line number of the calling line, and thus require the code to scan the program listings to RETURN.

Benchmark 6
300 PRINT"S" 400 K=0 430 DIM M(5) 500 K=K+1 510 LET A=K/2*3+4-5 520 GOSUB 820 530 FOR L=1 TO 5 540 NEXT L 600 IF K<1000 THEN 500 700 PRINT"E" 800 END 820 RETURN

Test 6 defines a small array at the start and adds another FOR-NEXT loop inside the main loop. This has little effect on the code, but is used to set a baseline for test 7.

Benchmark 7
300 PRINT"S" 400 K=0 430 DIM M(5) 500 K=K+1 510 LET A=K/2*3+4-5 520 GOSUB 820 530 FOR L=1 TO 5 535 M(L)=A 540 NEXT L 600 IF K<1000 THEN 500 700 PRINT"E" 800 END 820 RETURN

This assigns a value to each of the array elements every time through the loop. Comparing the time needed to run 7 to 6 indicates the efficiency of array access.

Benchmark 8
300 PRINT"S" 400 K=0 500 K=K+1 530 A=K^2 540 B=LOG(K) 550 C=SIN(K) 600 IF K<100 THEN 500 700 PRINT"E" 800 END

Test 8 was added by PCW, performing several transcendental functions in order to test their performance. This code does not include the code from test 7, which breaks the original pattern of each test adding to the last. Instead, the associated article listed both the time to run 8 and 7 and 8 combined.

Sample results
This list is not meant to be exhaustive, but instead a quick overview of the results seen on some popular systems of the early microcomputer and home computer era. The first table includes a selection of machines from the original tests in June 1977, with exceptions as noted. Test time is in seconds.