C (144/254)

From:Colin Wenzel
Date:06 Apr 00 at 13:30:08
Subject:Re: SetAPen benchmarks...

On 06-Apr-00, Olaf Barthel wrote:
> On Apr 06 Allan (Allan Odgaard) wrote:
>> Hi there,
>>
>> Some days ago someone asked about SetAPen overhead. I've tested it
>> and it's approximately five times faster to do this:
>>
>> if(GetAPen(rp) != mypen)
>> SetAPen(rp, mypen)
>>
>> Than to always just setting the pen, assuming that the pen is
>> already set. This was on my 40MHz 040, testing both AGA and P96 for
>> CLUT and non CLUT screens. However, I could do around � million
>> SetAPen's pr. second...
>
> The next question would be "why doesn't SetAPen() check for the
> pen number all by itself?". I can tell you the answer: it's for
> backwards, or rather, bug compatibility. I'm not joking. Back in the
> Kickstart 1.3 days developers discovered that what
> SetAPen()/SetBPen()/SetDrMd() would do was to work on the
> RastPort->minterms[] table and calculate new values for every change
> of drawing options. Since this was a slow process, some developers
> decided to cache the pen information stored in the minterms table and
> just copy the cached data there instead of calling SetAPen(), etc. It
> was faster, but it created a problem lateron when Commodore was
> updating the OS. One of the ideas brought forward during that time
> was to make SetAPen() and friends check the cached pen number and
> drawing modes before deciding to recalculate the minterms table. The
> OS code was changed to do just that, and lo and behold, suddenly some
> applications started to have problems rendering text and graphics.
> Those applications, Deluxe Paint was one of them, were poking minterm
> tables instead of calling SetAPen(), etc. properly. When the
> operating system started to rely upon the cached pen and drawing
> information to match the configuration of the minterm table, it was
> actually using stale data that didn't match the real configuration.
> In the end, it was decided that SetAPen() and friends should not rely
> upon the cached pen and drawing information and always recalculate
> the minterm table, no matter what.
>

Can I smell a new SetAPen2() etc...
Coming on for v3.6 ??

-------------------------------------
Colin Wenzel. Australia.

EMAIL: mailto:colstv@hotkey.net.au
URL: http://www.hotkey.net.au/~colstv/
ICQ: 17608330
AMIGA: 4000T, 68060/50, 150Mb RAM,
OS 3.5, EGS Spectrum.
---------------------------------------

------------------------------------------------------------------------
LOW RATE, NO WAIT!
Get a NextCard Visa, in 30 seconds! Get rates
as low as 2.9% Intro or 9.9% Fixed APR and no hidden fees.
Apply NOW!
http://click.egroups.com/1/2122/1/_/451227/_/955024362/
------------------------------------------------------------------------