Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!prls!pyramid!amiga!cbmvax!daveh From: daveh@cbmvax.cbm.UUCP (Dave Haynie) Newsgroups: net.micro.cbm Subject: Re: Re: Which C compiler is better?. Message-ID: <393@cbmvax.cbmvax.cbm.UUCP> Date: Thu, 12-Jun-86 13:51:37 EDT Article-I.D.: cbmvax.393 Posted: Thu Jun 12 13:51:37 1986 Date-Received: Sun, 15-Jun-86 04:13:15 EDT References: <6300002@hplsla.UUCP> Organization: Commodore Technology, West Chester, PA Lines: 48 > Nf-ID: #R:noscvax:-50700:hplsla:6300002:000:453 > Nf-From: hplsla!jamesv Jun 6 09:57:00 1986 > > >> The C-Power object code runs faster than any other compiler >> I've used on the 64; a Seive benchmark I ran executed in 40 seconds for the >> Proline compiler, 90 seconds in PROMAL, about 9 minutes in PASCAL, and 1 1/2 >> hours or so in C128 BASIC. > > Who's Pascal compiler are you using Dave? I'm not disputing your results > but the large difference between your results for C and Pascal surprise me. > > James Vasil > (hplabs!hplsla!jamesv) I'm not sure which PASCAL it was, I borrowed it from the guy next door just because he kept raving about how good his PASCAL package was. I'll look it up if you're interested. It think that the major difference between the C and the PASCAL is that the PASCAL quite likely compiles to some kind of P-Code, then runs in a P-Code interpreter; while the C code is pure 6502 machine language. The PROMAL compiler generates some kind of intermediate code as well, but the PROMAL language was designed to run very fast on a 6502 machine from the start, and it is limited in many ways as compared to C and PASCAL. Finally, as I recall from the documentation, I believe that the Pro-Line C compiler will first try to allocate variables in zero page of the 6502; that alone will speed things up. I think you could certainly create a faster PASCAL compiler than the one I used, though you might never get as fast as C, just due to the various operators C has that are designed to create faster and shorter code. Also, PASCAL compilers generate bounds checks on all array references at run-time, while C compilers don't. That just occurred to me. The Seive benchmark is array intensive; this more than anything else may be the most important factor -- it'll likely take longer to check the bounds of the array than to actually access an element of the array, depending on how this is done. There's no real efficient way to do this on a 6502 machine. PROMAL doesn't check array bounds either, as I recall. -- /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ Dave Haynie {caip,ihnp4,allegra,seismo}!cbmvax!daveh "As a dreamer of dreams and a travellin' man, I had chalked up many a mile." "I read dozens of books about heros and crooks, and I learned much from both of their styles.." -Jimmy Buffett These opinions are my own, though for a small fee they be yours too. \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/