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

Re: [pygame] Python and Speed



On Wed, Apr 16, 2008 at 6:43 PM, Dan Krol <orblivion@xxxxxxxxx> wrote:
Are you familiar with the handful of ways to optimize parts of your code?
I've used Psyco to great effect, but all of these extra modules seem to be treating the symptoms, not the problem.  The problem is flat-out and final--Python is slow, especially compared to C languages. 
Swig is the classic one I think, it wraps some C source into a python module.

Pyrex does a similar thing, but it lets you wrap it yourself with a
python-esque language; it lets you use python types and C types within
the same pyrex file, so you have control over when things get
converted between them.

Cython is Pyrex plus more features, but they're less conservative than
python as far stability (I think). Though their opinion is that pyrex
is too conservative. Check it out.

I think Boost somehow does it too, you'll have to look that up.
I should look into these for the time being.
I've never really used any of these other than to test it out though.
Thanks,
Ian