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

Re: [pygame] Back to the Scrolling

On Tue, Dec 03, 2002 at 08:27:54AM -0500, Phil Hassey wrote:
> Pete,
> > everyone feel free to send in ideas on how this could be improved a bit.
> > if there's a nice general way to get rid of the python overhead in
> > scrolling, i'm all for it. the big performance problem with full
> > scrolling is really copying all that memory around, and SDL makes it
> > happen twice internally, ugh.
> I suggest not adding any scrolling specific code to Pygame.  It seems that 

How about the Pythonism "Batteries Included"? Why not support as many
scrolling algorithms as people are willing to contribute? It'd make
developing with PyGame more convenient, as well as reduce the need for
external dependancies.

> One idea I had a while ago for making it possible to eliminate the python 
> overhead in scrolling / other tight loops is by using pyrex.  

Well, while the interpreter overhead can hurt somewhat, but as Pete
said, the major problem here is that memory is getting copied *twice*,
because SDL does it that way. While Pyrex is neat, with a more
memory-efficient backend and psyco (transparent, free optimization, as
long as you're on x86), it probably won't be needed so often :)

> http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/
> Pyrex generates C modules from "python-like" code that includes special 
> keywords for doing C-stuff.
> To really be able to use pyrex for pygame, I think pyrex would have to be 
> extended to be able to include header files.  (I believe this is planned...  
> Right now header files have to be redefined within your pyrex files.)

#include has been in Pyrex since 0.4, IIUC

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