From: "Salvador Eduardo Tropea (SET)" Newsgroups: comp.os.msdos.djgpp Subject: Re: FYI: speed of Allegro/DJGPP Date: 23 Oct 1997 07:03:10 GMT Organization: INTI Lines: 62 Message-ID: <62msre$rc0$c@195.26.68.19> NNTP-Posting-Host: 195.26.68.19 Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Comments: Authenticated sender is Dj-Gateway: from mailing list djgpp AT delorie DOT com Precedence: bulk To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk "Alan M. Doerhoefer" wrote: > This is my testament to the speed of DJGPP and Allegro: > [Sniped history about the fractal viewer] > > So I set out to make a version faster than my Allegro version. I > experimented with my old Borland C++ 3.0 and TASM 3.0. :-)), bad idea, I think the slow thing is the fractal calculus, not the screen. You can get over than 70 fps for a simple blit. > I wrote > my own TASM routine to write directly to VGA in Mode 13 and linked > it to C code identical to my Allegro version except for putpixel. > Then I tried different combinations of optimizing levels and or > inline assembler. I even wrote a Mode X version just for fun. > Here is my inline asm for Mode 13h: (thanks A. LaMothe) > > asm { > mov di, 0a000h > mov es, di > mov di, y > shl di, 6 > mov bx, di > shl di, 2 > add di, bx > add di, x > mov al, BYTE PTR color > mov es:[di], al > } > > All tests done on my Pentium 100 and the same CL-5434 graphics board: > frac with Win32: 200 + seconds > frac with bcc, tasm, Mode X 25 seconds > frac with bcc, tasm, Mode 13h 14 seconds > frac with DJGPP,Allegro,Mode X 7 seconds > > Allegro and DJGPP are FAST, at least under these circumstances. > Does anyone know where all this speed is coming from? Yes, the optimizer. > I assume > it is mainly because of two reasons: 1.) The latest DJGPP gcc is > 32 bit & well optimized for the 486 True. > 2.) Allegro's putpixel is well written. Yes, but the compiler (GCC) can make a better version of putpixel than you ;-)). Your real mode version is not so good. You can't compare the code generated by the old BC++ 3.0 with DJGPP. GCC optimize much better. SET ------------------------------------ 0 -------------------------------- Visit my home page: http://www.geocities.com/SiliconValley/Vista/6552/ Salvador Eduardo Tropea (SET). (Electronics Engineer) Alternative e-mail: set-sot AT usa DOT net - ICQ: 2951574 Address: Curapaligue 2124, Caseros, 3 de Febrero Buenos Aires, (1678), ARGENTINA TE: +(541) 759 0013