Re: [cc65] Optimizing C code

Date view Thread view Subject view

From: Ullrich von Bassewitz (uz_at_musoftware.de)
Date: 2003-09-09 10:43:17


On Mon, Sep 08, 2003 at 04:05:16PM -0700, Shawn Jefferson wrote:
> I realized that the test was actually running for 2 seconds, not 2 minutes.
> That was 345 plots per second.  Does that sound better?

Yes, it does:-)

> 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.
  
With the latter number (641 plots per second), this means that 20% of the
overall time is overhead, probably most of it moving the parameters to the
stack and back. If you're going to do some further optimization, you may want
to have a look at the call, too.

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz_at_musoftware.de
----------------------------------------------------------------------
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 10:43:25 CEST