David Ahl's benchmark

Discuss the games, programs, utilities... and vaporware!
User avatar
carlsson
Posts: 507
Joined: Fri Jun 13, 2008 7:39 am
Location: Västerås, Sweden

David Ahl's benchmark

Post by carlsson » Tue Dec 17, 2013 8:28 am

Yesterday, I got reminded about David Ahl's benchmark, once published in Creative Computing. Back in the days there were a number of benchmark programs, starting with a suite in Byte magazine in 1977 that later on was extended in Creative Computing. As some people have complained about CreatiVision BASIC being so slow, before using the speed hacked version that seems to have other issues, I ran the benchmark to compare with other 8-bit computers of its day.

Ahl's benchmark is a combination of speed, aritmethic accuracy and quality of the random number generator. I omitted the random results, as I find one would have to run the benchmark a number of times to get an average value. The code looks something like this, adjusted to be run on CreatiVision BASIC:

Code: Select all

10 rem Ahl's simple benchmark
20 for n = 1 to 100
25 a = n
30 for i = 1 to 10
40 a = sqr(a)
45 r = r + rnd(0)
50 next i
60 for i = 1 to 10
70 a = a**2
75 r = r + rnd(0)
80 next i
90 s = s + a
95 next n
100 print "Accuracy ";abs (1010-s/5)
110 print "Random ";abs (1000-r)
On some systems, the ** or ^ function is missing and one has to use A*A. However BASIC is much faster doing A*A than A^2 so that skews the results.

The following results were timed, the majority on actual hardware:

Acorn Master Compact: 7.5 sec - accuracy 0,000022
Acorn BBC B: 21 sec - 0,000013
Acorn Electron: 29 sec - 0,000013
MSX Turbo-R: 30 sec - 0,0000002 ish
Apple IIc Plus: 31 sec
Amstrad CPC-6128 Plus: 39 sec - 0,00035 (Locomotive BASIC 1.1)
Atari 8-bit: 42 sec - 0,013 (Turbo BASIC XL)
Apple IIgs: 43 sec - 0,00104
VTech Laser 2001: 45 sec - 0,00034 (using A*A, I need to check if A**2 works here as well)
Atari 8-bit: 50 sec - 0,014 (BASIC XE)
Panasonic JR-200: 58 sec - 0,000218
Tandy CoCo 3: 71 sec - 0,000596 (69 sec with faster keyboard routine)
Atari 8-bit: 101 sec - 0,15 (Microsoft BASIC)
Dick Smith VZ-300 a.k.a. VTech Laser 300: 108 sec - 0,0338745
Commodore Plus/4: 109 sec - 0,00104
Commodore 64: 123 sec - 0,00104
Tandy MC-10: 123 sec - 0,000596
Oric Atmos: 144 sec - 0,00104
VTech CreatiVision: 191 sec - 0,37 (BASIC 1.0)
Atari 8-bit: 230 sec - 0,0018 (8K BASIC + Mathpack)
TI-99/4A: 235 sec - 0,00000001 (TI Extended BASIC)
TI-99/4A: 271 sec - 0,00000001 (TI BASIC)
ZX Spectrum: 290 sec - 0,00067
Atari 8-bit: 396 sec - 0,013 (BASIC XL)
Atari 8-bit: 405 sec - 0,013 (8K BASIC)
COMX-35: 450 sec - 0,32 (approximate timing)
Atari 8-bit: 456 sec - 0,036606
NEC PC-6601: 496 sec - 0,000478

Of course one single benchmark doesn't give the whole picture, in particular as it is so repetitive but even the "slow" version of CreatiVision BASIC isn't that awful, e.g. compared to original Atari BASIC that ran with CPU RAM on a 1.79 MHz 6502 compared to our 2 MHz 6502 and VDP RAM. It is well known that TI BASIC (another VDP BASIC IIRC) and Spectrum BASIC are slow, but I'm unsure what NEC did wrong with their 4 MHz Z80 based PC-6601 unless that is an erronous measurement.

Now, we can overlook the fact that CreatiVision BASIC however seems to have the worst accuracy of them all, an error of 0,37 after all those square roots and squaring it back again. It is in line with the also bad-mouthed COMX BASIC while most others have 1/10 or much less error margin.
User avatar
Scouter3d
Posts: 646
Joined: Mon Jun 28, 2010 7:02 am
Location: Wien
Contact:

Re: David Ahl's benchmark

Post by Scouter3d » Tue Dec 17, 2013 8:51 am

Wow!

What a great difference between the Laser 2001 and the CreatiVision! (essentially beeing the same machine, except the amount of RAM i think...)

Would it be possible to implement the Laser 2001 Basic on the CV?

TOM ;0)
User avatar
Mobsie
Posts: 708
Joined: Fri Jun 13, 2008 10:38 am
Location: Weinheim, Germany

Re: David Ahl's benchmark

Post by Mobsie » Tue Dec 17, 2013 9:02 am

the CV Basic has some other very strange stuff inside which take a lot time, like the REM command etc. To speed up this Basic is possible. Also to implement some important functions like the Call function from the Laser 2001.
We work on our i/o interface draw our ideas, one it of course extra ram. This ram will then be used with a modified basic.
User avatar
carlsson
Posts: 507
Joined: Fri Jun 13, 2008 7:39 am
Location: Västerås, Sweden

Re: David Ahl's benchmark

Post by carlsson » Tue Dec 17, 2013 10:20 am

Yes, Barry Klein's speed hacked BASIC is already out there but there may be even better ways to improve the BASIC. As far as I can tell, one factor for slowness is that all program memory access has to go through the VDP rather than RAM that the CPU can address itself.
User avatar
MADrigal
Site Admin
Posts: 1189
Joined: Sun Sep 15, 2013 1:00 pm
Contact:

Re: David Ahl's benchmark

Post by MADrigal » Tue Dec 17, 2013 12:40 pm

This is very interesting! :D

Couldn't find the results of the hacked BASIC. What's the benchmark?
User avatar
carlsson
Posts: 507
Joined: Fri Jun 13, 2008 7:39 am
Location: Västerås, Sweden

Re: David Ahl's benchmark

Post by carlsson » Tue Dec 17, 2013 1:21 pm

The listing is in my first post. I thought it'd be a delight to type in with the moving-key keyboard, but at least the one that came with my latest CreatiVision console seems a bit sturdy, so just about as tough as using the default touch keyboard... I might try the hacked version from the multicart tonight, unless nobody gets ahead of me. The RND function will apperently return the same value for every call within one RUN session with the hacked version, but it shouldn't make too much of a difference.
User avatar
Mobsie
Posts: 708
Joined: Fri Jun 13, 2008 10:38 am
Location: Weinheim, Germany

Re: David Ahl's benchmark

Post by Mobsie » Tue Dec 17, 2013 1:25 pm

yes, both keyboard are strange! I love my Vic keyboard. I will compare the matrix of both, maybe is possible to use a VIC keyboard without change to much.
Interesting to see your result later with the speed hack version.
User avatar
carlsson
Posts: 507
Joined: Fri Jun 13, 2008 7:39 am
Location: Västerås, Sweden

Re: David Ahl's benchmark

Post by carlsson » Tue Dec 17, 2013 1:39 pm

Yeah! First the C2N adaptor, then your plans to possibly interface a 1541, then a Commodore keyboard, perhaps an expansion cartridge with extra RAM and a SID chip, apparently we need Atari joystick adaptors as well, the cartridge port is physically already quite well dimensioned, perhaps we can use the genlocking (?) feature of the VDP to overlay a VIC-II on top of it... When we're finished, we have rebuilt the once uncommon and unique CreatiVision to become a somewhat clumsy C64 clone. :lol:
User avatar
MADrigal
Site Admin
Posts: 1189
Joined: Sun Sep 15, 2013 1:00 pm
Contact:

Re: David Ahl's benchmark

Post by MADrigal » Tue Dec 17, 2013 1:41 pm

carlsson wrote:When we're finished, we have rebuilt the once uncommon and unique CreatiVision to become a somewhat clumsy C64 clone. :lol:
:lol:
User avatar
Scouter3d
Posts: 646
Joined: Mon Jun 28, 2010 7:02 am
Location: Wien
Contact:

Re: David Ahl's benchmark

Post by Scouter3d » Tue Dec 17, 2013 3:02 pm

carlsson wrote:Yeah! First the C2N adaptor, then your plans to possibly interface a 1541, then a Commodore keyboard, perhaps an expansion cartridge with extra RAM and a SID chip, apparently we need Atari joystick adaptors as well, the cartridge port is physically already quite well dimensioned, perhaps we can use the genlocking (?) feature of the VDP to overlay a VIC-II on top of it... When we're finished, we have rebuilt the once uncommon and unique CreatiVision to become a somewhat clumsy C64 clone. :lol:
Don`t quit understand the cynism...
I thought that's what keeps the Scene alive, writing new games, interfacing other Hardware, exploring what is possible...

TOM :0)
Post Reply