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

Re: [pygame] How fast is pygame meant to be?



Pete Shinners <shredwheat@attbi.com> writes:

> Christian Perfect wrote:
> > down to around 15/20 fps when there are lots of frags on screen. I
> think my
> 
> > question's answered, then - don't use pygame for pixel plotting :P
> 
> this is true. any intense pixel work will definitely show up on the
> python scale of speed. if we needed we could probably hardcode some of
> 
> the effect down and gain a little extra speed. the only fortunately
> thing is that python mixes easily with C, so particle systems could be
> 
> handled elsewhere inside a game.

Out of curiosity I tried using psyco on this script, and inheriting
the frag class from psyco.classes.psyobj and using psyco.bind(main)
seemed to provide a substantial speedup (I haven't measured it exactly
because the application is input driven). 

To give an impression of the speedup I can say that without psyco
optimizing the frame slows steadily until about 10 frames per second
when I click the mouse as fast as I can, and in a position fairly high
and in the middle of the screen (where there is bound to be most frags
on the screen). With psyco I can push fairly fast on the mouse button
without leaving frame rate sync, and while pushing as fast as I
possible can on the mouse, the frame rate doesn't go lower than about
37 fps. Impressive in my eyes.

-- 

Vennlig hilsen 

Syver Enstad


____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org