MSX Programming Languages – Fight!
September 15th, 2013
Here are some preliminary results from a compiler/interpreter test, where we pitted different MSX compilers and cross-compilers against each other. The test was a simple integer addition loop. Here’s the Pascal version for a reference:
Program Bensmark; Var i,j,s:Integer; Begin s:=0; For i:=1 To 10000 Do For j:=1 To 100 Do s:=s+1; Writeln(s); End.
The snippet tests mostly loops, so the results can’t be generalized for all sorts of purposes. Anyway, here comes the list with execution times in seconds, arranged from fastest to slowest:
- Mildly unrolled assembly: 4
- Trivial assembly implementation: 8
- SDCC C cross-compiler 2.9.0: 13
- MSX-C 1.20: 44 – painfully slow compilation
- X-BASIC: 47
- Turbo Pascal: 62 – quick compilation
- z88dk C cross-compiler: 86
- Hisoft C 1.35: 154
- Hisoft Pascal: 880 – extrapolated from a shorter loop
- MSX-BASIC: 2500 – extrapolated from a shorter loop
Some big surpises there, actually. I expected a lot better performance from z88dk and Hisoft C, but they lost even to the ancient Turbo Pascal. TP got a big plus for its swift compilation time, too. X-BASIC went on to show that BASIC doesn’t need to be slow at all. In spite of its problems and somewhat modest code generation, SDCC easily took the crown of compiled high-level languages here.
1 Comment Add your own
1. PopolonY2k | May 31st, 2015 at 3:14 am
Try this in Turbo Pascal.
Begin
s:=0;
For i:=1 To 10000 Do
For j:=1 To 100 Do
S := Succ( s );
Writeln(s);
End.
I think that this is is a little bit faster.
Kommentin kirjoitus
You must be logged in to post a comment.
RSS feed for comments on this post.