[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygame] [OT] optimization

On Mon, Nov 11, 2002 at 08:22:57AM -0800, intangir intangir wrote:
> hi, I need an hint from you pygame developers.
> When I needed to optimized my game to get a more funny
> speed, I used to rewrite in C some parts in my code
> where there were low algoritmical loops, usually
> helped by pyrex. Now I've noticed psyco, a
> just-in-time compilator, that provide a good
> optimization without rewrite no line, and especially
> it can handle entire classes. Which of these ways
> would you suggest me? Rewrite in C critical fragments
> or to have trust in psyco?

0) ask yourself if your program is too slow

1) profile

2) psyco.bind to the functions that are expensive

3) see #0

4) see #1

5) port bits of your application to Pyrex (or straight C, or whatever).

                        Christopher Armstrong
                    << radix@twistedmatrix.com >>
pygame mailing list