BASIC Benchmarks
BASIC Benchmarks
300 PRINT"START"
400 K=O
500 K=K+1
• • • information for
300 PRINT"START"
400 K=O
500 K=K+1
510 A=K/2*3+4-5
600 IF K < 1000 THEN 500
300 PRINT"START"
400 K=O
500 K=K+1
510 A=K/2*3+4-5
520 GOSUB 820
This is probably one of the most comprehensive execution even talk about how they've 600 IF K <1000 THEN 500
700 PRINT"END"
speed comparisons of the various BASICs available to the compared their own BASIC
800 END
hobbyists you've ever seen. Tom and Phil obviously put a lot with another one and 820 RETURN
of effort into the article and I'm sure you'll find their results "proved" that thei rs was
Fig. 5. Benchmark Program 5.
as interesting as I did. "al most twice as fast."
A side note conceming Imsai BASIC is in order. Imsai has Well, we've been curious
recently released a new version of their BK BASIC (Version about this ourselves, and we 300 PRINT"START"
1.4) which will not only have additional features such as PEEK 400 K=O
thought it was about time 430 DIM M(5)
and POKE, and the ability to CALL assembly-language that someone came up with 500 K=K+1
routines, but will also overcome the problems mentioned in some comparisons of the 510 A=K/2*3+4-6
520 GOSUB 820
this article. And in addition, they have a new Disk BASIC speeds of the various BASICs 530 FOR L=l TO 5
compiler which should be of interest to a lot of people. - that were a little bit more 540 NEXT L
John. precise than this. We didn't 600 IF K < 1000 THEN 500
700 PRINT"END"
hear any volunteers speak up, 800 END
* Also note addendum following this article - Ed. so we did it ourselves. Some 820 RETURN
of the results were very sur- Fig. 6. Benchmark Program 6.
Benchmark Number
Software/Hardware 2 3 4 5 6 7
**·22. Imsai 8K BASIC (1.31) 7.5 28.2 66.4 78.5 88.1 140.1 235.6
"lnteqer BASIC only.
··Some benchmarks could not be run. Others are incomplete.
··"Results for Imsai 8K BASIC. Version 1.31, from tests conducted by Tom Rugg
after article submitted for publication.
Fig. 8. Benchmark timings (in seconds).
67
CPU to be exceptionally fast to zero, add one to it, and The sixth benchmark has west Tech BASIC on a South-
(or slow), we don't really check to see if we've reached some interesting aspects, but west Tech machine, etc. In
know how much of that is 1000 yet. If not. we go back it's mostly a preparation for some cases, we couldn't do
due to the hardware and how and add one again. Since this the next one. It adds state- this, simply because we
much to the software. We can does the same thing as the ments 430, 530 and 540. It couldn't find anyone with the
draw some conclusions, first benchmark, it should creates the array M and does right machine, or the machine
though, by comparing how take about the same amount a five-time FOR-NEXT loop doesn't exist. So, we ran
different versions of BASIC of time, right? Wrong! It for each of the thousand Processor Tech's "BASIC 5"
do on the same CPU. takes an average of about five times in outer loop. This tests on a Digital Group 8080
One more thing. There are times as long. There's a lesson a different condition than the system, and Programma's
lots of factors that go into to be learned here. first benchmark, which is also TBX (Tiny BASIC Extended)
deciding which BASIC and The second benchmark is a FOR-NEXT loop, because was run on a Sphere 330 (a
which computer are best for used as a basis for all the rest this one executes a small 6800-based machine). TDL's
you. We're just looking at the of the benchmarks. What we inner loop a thousand differ- Zapple BASIC was run on an
speed of some small pro- do is continually add more ent times. Initializing a small Altair 8800a with a TDL ZPU
grams. Large programs (with and more statements between loop one thousand times is board in it. By the way, did
lots of variables to look up in lines 500 and 600. These quite a bit different from you know that neither the
internal tables) might come statements will be executed initializing a large loop once TDL ZPU nor the Cromemco
out different. You also have 1000 times, and we can see (as Benchmark 1 did). Z-80 board will work in an
to consider cost, availability, how much time is added by The last benchmark Altair 8800b? This fact hasn't
reliability, support by the adding each statement. That (number 7) adds statement been given too much public-
vendor, number of digits of way we can figure out which 535. This tests the amount of ity, as far as we've seen.
accu racy, ease of use, com- BASICs ·are most efficient at time it takes to place a value Note that some of the
patibility with other hard- each type of statement. In in an array. Since arrays are BASICs are marked with an
ware and software, loading addition, the last benchmark so frequently used by so asterisk in Fig. 8. Thes~ are
time, special features, and will have a variety of types of many programs, it's impor- the ones that only handled
other miscellaneous factors. statements in it, so we can tant to know how long it integers (no floating point).
Speed may not be important use it as our measure of how takes BASIC to figure out For a while we considered
to you. But if it is, read on. fast each BASIC is overall. which element you're refer- eliminating them from our
The th ird benchmark adds ring to (the "Lth" one here) results, since they obviously
The Benchmark Programs statement 510 to the pro- and then put a value into it have an advantage in process-
By now you've probably gram. It does a divide, a (A). Notice that we're execut- ing speed. But when we saw
already sneaked a look at the multiply, an add, and a sub- in g this statement 5000 how some of them came out
table of benchmark timings, tract - using variables only. times. in the standings, it didn't
so we'd better explain each of We did this because some of look like it was necessarily as
the benchmark programs. the BASIC manuals tell you The BASICs That Were much of an advantage as we
Remember, there's nothing to use variables instead of Tested expected.
magic about these programs. constants to make your pro- We ran the benchmarks on In glancing down the list
They're just some that we gram run faster. If so, this just about every BASIC we of BASICs that were tested, a
made up so they would be benchmark should run faster could get our hands on for a couple of things are quickly
short and simple and would than one that was doing these few minutes. We went around noticeable. First, we tested
test the speed of certain fea- operations with constants, to computer stores, hobbyist more versions of Altair
tures of BASIC that we right? meetings, friends' houses - BASIC than anything else.
thought were important. The fourth benchmark wherever new BASICs could The reason for this is pretty
All the benchmark pro- provides the answer. It re- be found. It seemed sort of simple. More people used it
grams print "START" at the places statement 510 with like stamp collecting after a than any other BASIC we ran
beginning and "END" at the one that does the same opera- while. "Ah! Here's one we into, and more versions of it
end. The length of time tions, but uses one-digit con- haven't found before!" exist than any other.
between the two is what we stants instead. Sure enough, We even tried them on a The second thing is that
measured. the program runs longer this super computer, a Control we obviously didn't test every
The first benchmark is way on nearly all the micro Data Cyber 174. We had to version of microcomputer
nothing but a simple FOR- BASICs. use its internal clock (our BASIC that exists. Sorry, but
NEXT loop. All it does is Benchmark number 5 adds reflexes and stopwatch we just couldn't arrange to
make the variable K go from statements 520 and 820. All weren't quite good enough). test some of them. If you
one to a thousand. Ever they accomplish are a simple It's interesting to see how the have one we didn't test (and
wonder how long something GOSUB to a dummy subrou- big guy compares with all the you live in the Los Angeles
like this would take? Depend- tine that does nothing but Iittle guys. In addition, since area), let us know and we'll
ing on which micro's BASIC RETURN. We were curious it's a lot faster than all the set up a test with you. If
we used, it took anywhere how long it took to do this, micros, this will prevent any- there's enough interest, we
from 1.3 seconds to 14.9 since it is a common program- body else from claiming he can publish an update in a
seconds. Quite a spread. ming technique (and a good came out on top in our later issue. That'll also give all
The second benchmark one, we feel) to break up a benchmark. the vendors a chance to come
program does the same thing program into a series of When possible, we tried to out with some new versions
(logically), but in a different subroutines and GOSUB to run somebody's BASIC on his of BASIC that perform
way. Instead of using a FOR- them from a mainline rou- own machine. We ran Altair better. After all, isn't that
NEXT loop, we set K equal tine. BASIC on an Altair, South- what we really want to get
68
out of all this? pretty fast. BASICs finished down near 30 to 40 per cent slower than
the bottom. Apple expects to the average 8080 BASIC
Imsai BASIC The Hardware That Was have a BASIC with floating (nearly 60 per cent slower
A special explanation is Tested point available by about July. than the fastest). But Altair's
required for Imsai BASIC, There were four micro- It'll be interesting to see how 680 BASIC looks great com-
especially since so many computer chips represented much it slows down. pared with the other 6800
people seem to have (and in the benchmarks. Apple BASICs. The two TBX ver-
A fter Apple comes a
like) Imsai computers. Bench- (not Zapple) uses a 6502. sions (and both are integer
cluster of Z-80 and 8080
mark 1 was the only one that Southwest Tech, the Altair BASICs, remember) took 2 to
BASICs. TDL's Zapple 8K
we could run the same way as 680b, and the Sphere use the 2'12times as long!
BASIC just barely came out
on other versions of BASIC. 6800. The TDL ZPU and the The Southwest Tech
in front of Altair 8K BASIC
Benchmarks 2 and 5 could Digital Group Z-80 use the B AS I C was even slower
(versions 4.0 and 3.2). TDL's
not be run at all. The rest of Z-80. All others use the 8080. (although not by much). We
ads claimed that it was "20%
them were run in an incom- We made sure that no slow realize that SWTPC's BASIC
faster than Altair." Our
plete way. memory was used. All handles nine significant digits
benchmarks show that it's
Here's what happened. We machines were thought to be and does BCD arithmetic, but
only a little over one per cent
went around to four different running at their full rated 204 seconds compared with
faster than the fastest Altair
Imsai dealers to try to run the speeds by their owners. If 81.8 seconds tells us that
BASIC, and it's slower at
benc hmarks with Imsai you run these benchmarks on there's some work to be done
some things (look at bench-
BASIC. One of them said, "It your machine and discover to improve things. And when
mark 2). It is nearly 20 per
doesn't work." Another said significant differences you compare it with 51.8 for
cent faster than the slowest
his people had tried a couple between your results and Zapple and 52.4 for Altair 8K
Altair BASIC (4K, version
of times without success and ours, we'd like to hear from (on the 8080)' well, there's a
4.0). Keep in mind, though,
then gave up. The third you. Please be sure that you lot of work to be done.
that if we had run another set
worked with us to try to enter the programs exactly as Another thing that's inter-
of benchmarks (maybe with a
bring it up and partially they are shown (spacing is a esting to look at is which
lot of string processing or
succeeded. We could enter factor in BASIC's speed, you BASICs are fastest at which
square roots or something). it
programs and run them, but know). We would hope that things. For example, if you
might have turned out that
they really didn't do any- your results would be within subtract the time for Bench-
we agreed with TDL.
thing. All variables were stuck one percent of ours. mark 4 from the time for
at zero and couldn't be Most of the 8080 and Z-80 Benchmark 5, you can see
changed, and we were getting The Results BASICs came out in the 50 to how long it takes to do 1000
strange errors for no apparent Now that we've talked 70 second range. Digital GOSU Bs and RETURNs.
reason. about what we were trying to Group's Z-80 Maxi-BASIC is You'll find that Altair Ex-
do and how we did it, let's an interesting case. Even tended BASIC, version 4.0
The fourth dealer had
finally take a look at the though it uses the Z-80 and (both Disk and 12K) took 1.2
more success. We were able to
results to see what we can runs at 2.5 M Hz, it still fin- seconds for this - the best of
run our BASIC programs, but
conclude. Remember, we're ished behind several others. all the micros we tested.
certain things didn't work.
looking at the times for (Zapple ran at 2 MHz, as do
Specifically, any kind of
benchmark 7 as our overall all the 8080 based com- A Final Word
branch instruction (GOTO,
measurement. puters.)
GOSUB, etc.) wouldn't work! We hope you found this
He said the same thing had First of all, there's abso- We were also sort of sur- study interesting. You can
happened before. To say the lutely no question that prised that there wasn't more bet that the computer store
least, th is is a pretty severe BASIC on the Control Data variation in the speeds of the owners who were looking
programming restriction. As a Cyber 174 came out on top. 8080 and Z-80 BASICs. They over our shoulders found it
result, we couldn't run bench- If you have a few million all finished within about 20 interesting. They were with-
marks 2 and 5 at all. Bench- dollars in loose change rat- seconds of each other (except out exception very friendly
mark 3 had to be done with a tl ing around in your pocket, Imsai's). All the Altair ver- and helpful, but they were
FOR-NEXT loop (like bench- go out and get one. sions came out looking pretty also concerned about how
mark 1), as did all subsequent To tell the truth, we were good, but the others weren't their products were stacking
benchmarks. Benchmarks 6 surprised that there wasn't a really very far behind. By the up against the competition.
and 7 didn't have the bigger difference between way, you can observe that So be fair to them and the
GOSUB-RETURN statements number one and the rest of the Altair 12K Extended BASIC manufacturers - remember
in them. field. Apple BASiC only took (4.0) and Disk Extended that pure speed is only one of
I msai's documentation 27 times as long as the BASIC (4.0) have almost the factors you need to con-
says that this version of 8K CDC,and about half the field identical timings right down sider when buying a com-
BASIC (1.3) is a "pre- finished in less than 60 times the line. That tells us that puter. At the same time,
liminary" one. Considering its as long. We expected a much they are probably similar. however, we hope this article
extremely slow speed (it larger gap here. The 8K version is obviously has made you realize that
takes over twice as long as the Speaking of Apple BASIC, quite a bit different. there are some pretty good
next slowest 8080 BASIC) look how far in front of the All of the 6800-based ways of comparing the power
and the fact that many rest of the micros it came BASICs are down at the of different computer sys-
people are having problems out. Sure, it's an integer bottom of the Iist. Here we tems. Now if you'll excuse us,
getting it to work, we hope BASIC, but that's still an see a wide vanation in we're going to load BASIC on
they can come out with a awfully impressive perfor- timings. Altair 680 8K BASIC our new Cyber 174 so we can
final version to replace it mance. Some other integer took 81.8 seconds - about play Star Trek.
69
During a phone conversa- 3_ The transcendental func- *We used a watch with a *Each benchmark was run
tion with Robert Uiterwyk, tions (sine, cosine, tangent, sweep second hand, so we three times, with the average
the man who developed exponents, etc.) should suspect our times to be accu- shown as our benchmark run
SWTP's 8K BASIC, I hap- execute twice as fast as rate to only Y, second. time.
pened to mention Tom and before due to modifications "The Imsai 8K BASIC is in
By the authors' charted
Phil's article and asked if he found in Version 2. - John. 1702 EPROM using lV2 wait results, Poly-88 11 K BASIC
had any comments regarding states per mach ine instruction
and Northstar Disk BASIC
the results of the benchmarks access. It goes without saying
performed midrange in speed,
(in particular, of course, the As a result of our submitting that this alone slowed the
and the Imsai 8K BASIC
fact SWTP's BASIC was so this article to several local programs way down.
performed by far the slowest;
slow). computer stores, we were "The Imsai 8K BASIC was however, keep in mind the
He wasn't even a little bit pleased to receive the follow- run with an Imsai 8080 frame 1Y, wait states per access on
perturbed. His reaction was, ing response from Microcom- and CPU, using a Teletype as the 1702 EPROMs. I'm not
"Of course it's slower than puters, Inc. We invite other output device. sure how to bend the Imsai
the others ... it does more." stores to submit their own
"The Poly-88 11 K BASIC results to compare with
fie had three points to make benchmark results. - Ed.
was run in a Polymorphic the others, so I haven't. I
regarding the speed:
Along with Imsai 8K System 16 (16K RAM with hope you can use this addi-
1. It's going to be slower BASIC, our store also has no wait states, Poly video tional information, and once
because it provides 50% more Polymorphic 11 K BASIC and output). again, my compliments on a
significant digits than other Northstar BASIC (on their "The Northstar Disk BASIC very good effort.
BASICs. SWTP BASIC gen- disk system). Thus, our was run with an Imsai 8080 Stephen M. Pereira, Pres.
erates nine significant digits benchmark times for all three frame and CPU, using TTY Microcomputers, Inc.
whereas "everyone else uses BASICs. First, a few words again for output, and RAM 539 Amherst St.
six." This additional accuracy on how we did the testing: needing no wait states. Nashua NH 03060
contributes to an overhead
BASIC/machine BM1 BM2 BM3 BM4 BM5 BM6 BM7
increase of about 50%. Imsai 8K ver 1.3 11.5 39 92 110 121.5 191 320
2. The BCD arithmetic oper- Imsai 8080
ations contribute approxi- Northstar ver 6 3.5 10.5 28 32.5 34.5 51 74.5
mately 20% in increased over- Imsai 8080
head but also provide in- Poly 11 K ver 9V27 2.5 10.2 29 34 36.5 54 79
Poly-88 System 16
creased accuracy for those
operations. Table of benchmark timings (in seconds).
LOW COST
MEMORY
16K x 8 BIT C!J1>l£TE KIT llICUIES JIWII), OiIPS, CAPS.
$79.95
& IXlClI£NTATl(J~
DYNAMIC
RAM
450 ns low - power 2102-1 $ 1.60
512 x 8 bipolar prom $17.00
16K x 1 250 ns dynanic ram $54.00
Model Description Price NEW: 64K S·100 dynamic ram board $395.
ASSEMIILED 6 TESTED WITH 161t RAM
WWW-16KA Fully Assembled $650.00
WWW-16KK Kit
Iv
$550.00
WASATCH SEMICONDUCTOR PRODUCTS
25 SOU1H JlJ EAST, sum 215
4
WWWENTERPRISES SALT lAI<E CITY, UTAH 00ll
P.O. Box 548,
Fa! CJ«:ERS l.tG:ER $25, OJ, AlIl $2 ,OJ SH I PP ING PlID HAIIIl..l NG
Harbor City CA 90710
UTAH RESIlENTS AlIl S% SAI£S TAX ~
(213) 835-9417 W13
W-14
70