Re: [cc65] Optimizing C code

Date view Thread view Subject view

From: Shawn Jefferson (sjefferson_at_sd62.bc.ca)
Date: 2003-09-09 01:05:16


>>> Ullrich von Bassewitz <uz_at_musoftware.de> 09/05/03 02:13AM >>>
>On Thu, Sep 04, 2003 at 02:09:50PM -0700, Shawn Jefferson wrote:
>> Your way (above) gave me 338 pixels per minute, and leaving it the old way
>> gave 345.
>
>This is about 6 pixels per second which is pretty bad. I don't know how much
>overhead the call alone (and your test program) has, because this depends
>somewhat from where the data comes from. You can try your benchmark again with
>all code within the plot function removed. The difference is the almost exact
>time needed for the guts of the plot function.

I realized that the test was actually running for 2 seconds, not 2 minutes.  That was 345 plots per second.  Does that sound better?

I commented out all the code from my plot function and got 3096 per second, which is just a small timing loop and calling my plot function.  I also made another optimization of the plot function by precalculating the bytes per line for the bitmap which bumped up the number to 641 per second.  That also helps several other functions as well.

Thanks,
Shawn Jefferson

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2003-09-09 01:08:20 CEST