General Category > Off topic

Amstrad CPC Machine code speed test

<< < (2/2)


--- Quote from: MaV on 14:05, 23 April 18 ---litwr wrote a bunch of machine code programs for various platforms intended for speed comparisons.

--- End quote ---

Any links [emoji848]

Sent from my iPhone using Tapatalk


--- Quote from: ukmarkh on 20:50, 24 April 18 ---Any links
--- End quote ---
There you are. Calculating PI with the spigot algorithm.
For some reason I thought there was more than one type of benchmark, but it certainly is more than one platform.


The problem with micro-benchmarks like this is that they don't really meaningfully translate into practical results once you go beyond really high level tasks like BASIC (where they're really as much a test of how well the interpreter performs rather than the machines per se). I've seen multiplication routines on a 1MHz 6502 that can outperform a 4MHz Z80, but do so by monopolising the zero page in a way you probably can't do in a real-world application without taking a massive performance hit elsewhere. Equally some types of problem are better suited to one machine over the other - for example anything that prints text has a huge advantage on the C64 in not needing to update a bitmap, but anything that draws graphs (or mixes text and graphics) takes a hit because the C64 display doesn't particularly lend itself to that (and manipulating it in bitmap mode exposes the slower raw CPU grunt).

Coincidentally that was the first project I picked up after learning the basics of Z80 assembly.

I used a short program calculating the number of primes up to 1000. Not having any other 8-bit machine to test against, I used my PC (AMD Ryzen 5 3600) with an equivalent program written in C++.

Results [drumroll]:

* CPC: 0.16 seconds,
* PC: 5 microseconds (0.000005 seconds),so only 32000x difference :D 

If you're interested in the code, you can find it here:


--- Quote from: ukmarkh on 20:44, 22 April 18 ---and every 8bit Machine in regards to basic
--- End quote ---

Afaik not the BBC Micro.


[0] Message Index

[*] Previous page

Go to full version
Powered by SMFPacks Reactions Mod
Powered by SMFPacks Alerts Pro Mod
Powered by SMFPacks Mentions Pro Mod