A POWER C Benchmark

@NoelsRetroLab published an interesting video on YouTube called „TI-99/4A BASIC Performance, Games and Comparison to Other 8 Bit Systems“. In the video, he benchmarks a couple of computers (mostly using the MOS 6502 CPU) using a short BASIC program:

10 FOR I=1TO10
20 S=0
30 FOR J=1TO1000
40 S=S+J
50 NEXT J
60 PRINT ".";
70 NEXT I
80 PRINT S

With the help of others he published an extensive list of computers running this benchmark. A Commodore 64 is listed in there with a run time of 40 seconds. Just for fun, I added three numbers to the table with my own tests:

  • Vice (C64SC) @ 100%: 41.52 seconds
  • C64 Emulator Thomas Hochgötz: 40.32 seconds
  • Vice (C64SC) @ 200%: 20.92 seconds

I manually translated above BASIC program into POWER C and the result is

#include <stdio.h>
int main(void) {
  int i, j;
  double s;
  for(i=1;i<=10;i++) {
    s=0;
    for(j=1;j<=1000;j++)
      s=s+j;
    printf(". ");
  }
  printf("%.0lf\n", s);
  return(0);
}

Note that only a „double“ data type is large enough to hold the result (500.500). The floating point operations definitely slowed down the program, but an „int“ is to small.

The benchmark results for running the compiled program are

  • C64 POWER C, running in shell: 8.67 seconds
  • C64 POWER C, started from the BASIC prompt: 8.56 seconds

Again, the BASIC interpreter of the Commodore 64 needed 40 seconds! While not a fair comparison, it shows that using POWER C on the Commodore 64 can definitely make sense if execution speed is important. One just has to account for a larger memory footprint: the BASIC program takes up 1 block on the floppy disk, the C program takes up 9 blocks.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert


Der Zeitraum für die reCAPTCHA-Überprüfung ist abgelaufen. Bitte laden Sie die Seite neu.