Message-ID: <3501fea9.flying-brick@flying-brick.caverock.net.nz> From: Eric Gillespie To: djgpp AT delorie DOT com Date: Sun, 8 Mar 1998 14:12:55 NZT-12DST Subject: Speed Test - TC vs. DJGPP Reply-to: root AT flying-brick DOT caverock DOT net DOT nz Precedence: bulk I have come up with some rather interesting results on my AMD 486/40, w/8 megs of memory, which seems to be a VERY slow machine compared with the speed demons running under Win 95, NT and maybe even Linux DOSEMU. I have been comparing TC++ v1.0 with DJGPP 2.01, I got 22 tics for the TC executable, with the other times for DJGPP 2.01 compiled executables from the following compile lines: gcc -o speed.exe speed.c -s 90 ticks gcc -O (or -O2) -o speed.exe speed.c -s 55 ticks gcc -O3 -o speed.exe speed.c -s 5 ticks! The last result seems to be comparable to what the other person had got with TC3, so I'm not complaining! I revised the code slightly (to shut up TC++, and to actually get some work out of the function-calling mechanism). #include #include #include long sub(long i) { return(++i); /* just to get the function to DO something ... */ } void main(void) { clock_t start,end; long n,time; clrscr(); start=clock(); for (n=0;n<1000000L;) { n=sub(n); } end=clock(); time=(end-start); printf("\nBeginning tics: %ld \nEnd tics: %ld\n",start, end); time/=CLOCKS_PER_SEC; printf("sec:%ld\n",time); } Just to put my 2 cents in... I conclude there must be something wrong with using debugging options turned on - but why such a difference? The Viking -- Super User /| ,.:*^*:., |\ Cheers from the Viking family ... including Marmalade | |_/' viking@ `\_| | Running M$DOG in Christchurch! | flying-brick | $FunnyMail 5.38 C.S. Lewis: If Man has no God, \_.caverock.net.nz/ then where did Man's morals come from?