4 ms·
Well, yes and no. You're correct that ZX Spectrum is a lot slower than the author estimates, but there's also a software-side performance bottleneck: the code i
by pardoned_turkey 3y ago
Well, yes and no. You're correct that ZX Spectrum is a lot slower than the author estimates, but there's also a software-side performance bottleneck: the code is written in the built-in BASIC language, which on ZX Spectrum, was not only interpreted at runtime, but also almost comically unoptimized. For example, people would use "aftermarket" circle-drawing routines that performed 10x better than the stock ROM implementation.
BASIC on ZX Spectrum was meant for learning, but no serious software of the era relied on it for anything that needed to run fast.
I suspect this code could be 10x faster if written in assembly or a compiled language (a handful existed for the platform).
- YZF 3y agoYeah, there was a C compiler, a Pascal compiler... I'm pretty sure others. I would guess at least 100x for an optimized assembly version. Even 500x between this sort of interpreter and assembly is not unheard of.
- lproven 3y agoAnd a BASIC compiler. https://spectrumcomputing.co.uk/entry/8249/ZX-Spectrum/HiSoft_BASIC https://spectrumcomputing.co.uk/entry/8249/ZX-Spectrum/HiSof... The manual: http://hayne.net/Spectrum/HiSoftBASIC/manual.html http://hayne.net/Spectrum/HiSoftBASIC/manual.html
- YZF 3y agoHiSoft... that does bring back some memories.
- pjmlp 3y agoAfter learning to code on it, we used BASIC as means to write the utilities to load DATA statements representing Assembly code, hexdump monitors or compiled languages, although the later were relatively hard to take advantage of, given the space requirements.