Author Topic: Amstrad CPC Machine code speed test  (Read 1032 times)

0 Members and 1 Guest are viewing this topic.

Offline ukmarkh

  • 6128 Plus
  • ******
  • Posts: 1.420
  • Country: england
    • Classic Replay
  • Liked: 305
  • Likes Given: 76
Amstrad CPC Machine code speed test
« on: 20:44, 22 April 18 »
We all know that the Amstrad CPC kicks the C64 and every 8bit Machine in regards to basic, thanks to Locomotive, but how does it perform running a 1000 prime number raw calculations test in machine code, talking directly to the hardware in comparison to the other 8bits?

Has anyone ever tried this or written code, maybe this is something Amstrad Action covered, but it would be great to know.

http://retro64.altervista.org/blog/home-computer-basic-performance-tests-some-benchmarks/


https://youtu.be/pxye-RbKFpY





Sent from my iPhone using Tapatalk

Offline Urusergi

  • CPC6128
  • ****
  • Posts: 178
  • Country: es
  • Liked: 265
  • Likes Given: 1265
Re: Amstrad CPC Machine code speed test
« Reply #1 on: 02:18, 23 April 18 »
 :picard: That code is very slow and ugly. Instead, this one is super optimized (7.21 sec  8) ):

Code: [Select]
10 MODE 2:DEFINT a-y:ZONE 8:z=TIME:p=3:m=1000:DIM s(m+1):PRINT 2,
20 WHILE s(p):p=p+2:WEND:FOR i=p TO m STEP p*2:s(i)=-1:NEXT:IF p<m THEN PRINT p,:GOTO 20 ELSE PRINT:PRINT(TIME-z)/300

Offline ukmarkh

  • 6128 Plus
  • ******
  • Posts: 1.420
  • Country: england
    • Classic Replay
  • Liked: 305
  • Likes Given: 76
Re: Amstrad CPC Machine code speed test
« Reply #2 on: 09:41, 23 April 18 »
:picard: That code is very slow and ugly. Instead, this one is super optimized (7.21 sec  8) ):

Code: [Select]
10 MODE 2:DEFINT a-y:ZONE 8:z=TIME:p=3:m=1000:DIM s(m+1):PRINT 2,
20 WHILE s(p):p=p+2:WEND:FOR i=p TO m STEP p*2:s(i)=-1:NEXT:IF p<m THEN PRINT p,:GOTO 20 ELSE PRINT:PRINT(TIME-z)/300

Hi, but we need to rule out optimum or ugly code and talk directly to the hardware otherwise optimisation might be used as an argument in the other camps. It’s purely an experiment, outside of basic.


Sent from my iPhone using Tapatalk

Offline MaV

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.097
  • Country: at
  • Ius summum saepe summa est malitia.
  • Liked: 388
  • Likes Given: 822
Re: Amstrad CPC Machine code speed test
« Reply #3 on: 14:05, 23 April 18 »
litwr wrote a bunch of machine code programs for various platforms intended for speed comparisons.
Black Mesa Transit Announcement System:
"Work safe, work smart. Your future depends on it."

Offline Urusergi

  • CPC6128
  • ****
  • Posts: 178
  • Country: es
  • Liked: 265
  • Likes Given: 1265
Re: Amstrad CPC Machine code speed test
« Reply #4 on: 17:18, 23 April 18 »
Hi, but we need to rule out optimum or ugly code and talk directly to the hardware otherwise optimisation might be used as an argument in the other camps. It’s purely an experiment, outside of basic.

Yes, I understand you correctly. I was trying to say that my code, apart from being much faster, is more convenient or easy to make an assembly implementation (additions & multiplications by 2)

Offline ukmarkh

  • 6128 Plus
  • ******
  • Posts: 1.420
  • Country: england
    • Classic Replay
  • Liked: 305
  • Likes Given: 76
Re: Amstrad CPC Machine code speed test
« Reply #5 on: 20:50, 24 April 18 »
litwr wrote a bunch of machine code programs for various platforms intended for speed comparisons.

Any links [emoji848]


Sent from my iPhone using Tapatalk

Offline MaV

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.097
  • Country: at
  • Ius summum saepe summa est malitia.
  • Liked: 388
  • Likes Given: 822
Re: Amstrad CPC Machine code speed test
« Reply #6 on: 12:07, 25 April 18 »
Any links
http://litwr2.atspace.eu/pi/pi-spigot-benchmark.html
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.
Black Mesa Transit Announcement System:
"Work safe, work smart. Your future depends on it."

Offline andycadley

  • Supporter
  • 6128 Plus
  • *
  • Posts: 873
  • Liked: 411
  • Likes Given: 72
Re: Amstrad CPC Machine code speed test
« Reply #7 on: 10:32, 26 April 18 »

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).