delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/09/17/15:00:26

From: "Thomas Djafari" <frogger AT micronet DOT fr>
Newsgroups: comp.lang.c++,comp.os.msdos.djgpp,rec.games.programmer
Subject: Re: The numer 1 compiler, DJGPP or MSVC Here's a good rating comparision
Date: Wed, 17 Sep 1997 15:34:18 +0200
Organization: NetSat Inc.
Lines: 64
Message-ID: <5vomfv$bch$1@news.internetsat.com>
References: <3412BD25 DOT 1F30 AT mho DOT net> <3412DDA8 DOT C428AF45 AT a DOT crl DOT com> <341316EA DOT E14 AT mho DOT net> <34158665 DOT 8731090 AT news DOT concentric DOT net> <34148F08 DOT 7A16 AT pacbell DOT net> <5v5fm1$iku$1 AT vixen DOT cso DOT uiuc DOT edu> <3417b361 DOT 0 AT 139 DOT 134 DOT 5 DOT 33> <MPG DOT e831ef3f3b7c46f98982f AT news DOT videotron DOT net> <341baf04 DOT 0 AT 139 DOT 134 DOT 5 DOT 33> <MPG DOT e8609f75a7525fc98984b AT news DOT videotron DOT net> <341ceb68 DOT 0 AT 139 DOT 134 DOT 5 DOT 33> <01bcc1b6$1f9cce30$2b40cbc2 AT russnt> <341e6620 DOT 5108437 AT news DOT concentric DOT net> <01bcc1fa$a52f3350$2b40cbc2 AT russnt> <MPG DOT e8762716e334a21989855 AT news DOT videotron DOT net> <MPG DOT e8764aba8e6138e9896e2 AT nntp DOT chromatic DOT com> <01bcc27c$add7b720$2b40cbc2 AT russnt> <341f7974 DOT 0 AT 139 DOT 134 DOT 5 DOT 33> <01bcc353$59b5f490$2b40cbc2 AT russnt>
Reply-To: "Thomas Djafari" <tdjafari AT nordnet DOT fr>
NNTP-Posting-Host: gate4-230.nordnet.fr
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

I made some tests between watcom and djgpp yesterday

I had tried djgpp a long time ago, and it was generating slow code in
comparison of the watcom, but as it was a long time ago, I made a comparison
between the last version of djgpp (at least the one at DJ Delorie's page
(btw rhide fails on my computer :) ) and the Watcom 11 beta version

I used them with max optimisations :
watcom : /fpi87 /fp5 /oaeil+mnprt /s /mf/d1 /bt=dos4g /zdp /zq /5r /fhq /zu
djgpp : -O2 -m486 -fomit-frame-pointer -ffast-math  -funroll-loops

I made a very simple program which had 4 arrays of 1000 ints, fill them with
random values
the timing start from there : (arrays being a,b,c,d)
for(t=0;t<count;t++) a[t%1000]=b[c [ d[t%200]%500]%1000];
this wasn't exactly this function, but it was like this :)
count IS a constant, so the compiler can safely unroll loops
the timing takes in account the above function ONLY, not the inits, calls to
the lib, etc

I compiled, timed and also looked at the generated code.

the unrolling loop function of djgpp is much more intelligent that the
watcom's (which unrolls loops only if there's a very low count). djgpp
unrolled the loop 10 times

on this test djgpp gave a faster execution (like 17 seconds) than the watcom
(about 20)
the code generated by both compiler were very close, the most noticeable
difference was the loop unrolling

I tried to make another program which was taking the counter%10 and made a
switch and ten case, each case was just a simple math (add,sub,mul,div) like
4 or 5 operations per case

the watcom seemed to have generated clever code this time, but this wasn't
noticeable on the execution. maybe after one or several  minutes we may have
seen a difference due to a few clocks per iteration

then made a function like the first one, but with heavier maths in it
(result were multiplicated, divided, etc by other arrays' values, etc).
djgpp was the fastest too by 2-3 seconds out of twenty.

I also took all the previous tests and changed everything to floats (with
(int) casts before each array to run the first one) and this time.... the
watcom blown away djgpp with no possible comparison  : 6 times faster !
BUT the watcom has pentium-fpu optimization which is not known to djgpp

I'll continue my tests, it seems that djgpp has improved a lot since my
first test. but the gcc I've with my linux (slackware 2.0.0) SUUUUUUUCKS, it
generates the worst code I've ever seen,  maybe there's a newer version ?
(please tell me)

I'll make more complete tests and publish both results and source code, so
we'll be able to establish comparisons with msvc and bc++ too.








- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019