[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] pygame performance



I agree with Bob.

* Python is a very easy language to prototype in and is quite fast.  Very fast
sometimes. And it is perfectly suitable for building large programs in.

* Psyco (which I only discovered recently btw) can apparently give quite
miraculous speedups in some cases.

* When you have the system working reliably, look for the points of slowdown.
The worst case is that you may have to write a C module to handle some specific
hardware interactions - but with the way the OpenGL access from Python is going
that's going to be a rare requirement.

Jon

Quoting Bob Ippolito <bob@xxxxxxxxxx>:

> There's always ways to optimize things later. Write the code. If it's
> not fast enough, *profile* the code to see what's not fast, and take
> steps to optimize that part of the code.
> 
> Sometimes using psyco is going to be enough, depending on which
> platforms you care about. Otherwise you could change the rendering
> strategy to use OpenGL (which is still the fastest way to do anything,
> even in 2D), or writing some of the tight loops in C or C++ (possibly
> via Pyrex).
> 
> -bob
> 
> 
> On 10/18/06, Marcelo de Moraes Serpa <celoserpa@xxxxxxxxx> wrote:
> > I'm not into 3D yet either. But I really don't like slow rendering speeds
> on
> > 2D games. Blitz has an incredible fast 2D rendering speed but the language
> > is basic and I don't like basic!
> >
> >
> >  On 10/18/06, Mark Mruss <selsine@xxxxxxxxx> wrote:
> > > Yeah the performance of pyGame has always been a question for me,
> > > especially since I'm thinking of writing the entire game in straight
> > > python/pyGame.  Not a 3d game of course but a simple 2d game, a side
> > > scroller or puzzle game, and PyGame seems like a nice way to keep
> > > things simple.
> > >
> > > So for me I'd love to hear about what kind of performance people have
> > > been able to achieve using straight PyGame, and whether or not it
> > > makes sense to try this...
> > >
> > > mark.
> > >
> > >
> > > On 10/18/06, Marcelo de Moraes Serpa < celoserpa@xxxxxxxxx> wrote:
> > > > >So except if you want to code the next Unreal, you should have
> > > > >everything you need.
> > > >
> > > > Actually I want to code Quake 5 :D lol..
> > > >
> > > > That was just for the sake of curiosity. Thanks for the the info, it
> > helps
> > > > knowing how python works.
> > > >
> > > > Marcelo.
> > > >
> > > >
> > > >
> > > >
> > > > On 10/18/06, Lionel Barret de Nazaris < lionel.bdn@xxxxxxx> wrote:
> > > > > Marcelo de Moraes Serpa wrote:
> > > > > > Hello list!
> > > > > >
> > > > > > I used to use Blitz Basic to develop games some time ago. Now, I
> > want
> > > > > > to play with the wonderful world of game development again. I've
> > found
> > > > > > python to be a extremelly elegant, powerful and easy to use
> > language,
> > > > > > so, pygame seems to fit perfectly for what I'd like to do.
> However,
> > > > > > I've seen some games made with pygame and found that their overall
> > > > > > rendering speed is quite slow if you compare to other languages
> > (Blitz
> > > > > > Basic is actually quite fast). Maybe it was an isolated issue but
> > I'd
> > > > > > really like to know from more experinced developers on the
> > performance
> > > > > > of python/pygame.
> > > > > >
> > > > > > Thanks in advance,
> > > > > >
> > > > > > Marcelo.
> > > > > Mmm...i don't know much about blitz basic but AFAIK it is a static
> > typed
> > > > > / compiled language.
> > > > > Python is interpreted which make it slower (it cannot guess the
> > > > > execution path as almost anything can be changed at runtime).
> > > > > For most app, the relative slowness in not important and largely
> > > > > compensated by the productivity boost.
> > > > >
> > > > > Games are in the gray area. the many loops (rendering, collision,
> etc)
> > > > > imply many function calls which is slow in python.
> > > > > Complex 3D (like seen in commercial AAA games) is quite out of the
> > > > > question for now *but* simple games are very easy to do. With the
> help
> > > > > of openGL it quite easy to get over 100 fps.
> > > > >
> > > > > So except if you want to code the next Unreal, you should have
> > > > > everything you need.
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> >
> >
> 




--------------------------------------------------------------------
Come and visit Web Prophets Website at http://www.webprophets.net.au