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

Re: [pygame] Python and Speed



Hi Ian,

    I think what you are saying and I agree, is that when someone has fixed
something by going back to C code, then why not make a module for that code.
Thus all you do is insert the C code using a Python/Pygame module name...

    But slowing down is when it uses the Python interpreter, but why not the
C interpreter? Or make Python code that uses that format, but runs under the
C interpreter? After all, it is all about ease in writing, higher level
language using the lower level code under just a different name for
translation, but normal C code once interpreted or translated...


        Bruce


Ian Mallett <geometrian@xxxxxxxxx> wrote:
>  Are there any plans to improve Python's speed to
> at least the level of C languages?

This isn't really the best forum for asking such a question. I would
recommend asking on the general Python mailing list / newsgroup
("comp.lang.python" on http://www.python.org/community/lists/).

I think I speak for all Python developers when I say that we'd love for the
language to run faster. And of course the large body of core CPython
developers are aware of this. I've personally attended a sprint in Iceland
during which we spent a week solely focused on speeding up the CPython
interpreter.

There's just not much that can be done with the current CPython
implementation to make it faster.

Thus it falls to you as a developer to choose your implementation strategy
wisely:

1. pick sensible libraries that handle large amounts of processing for you
(whether that be numeric or graphic)
2. where there is no existing library, you may need to code speed-critical
parts of your application using C, or the more programmer-friendly Pyrex
(er, Cython these days I believe :)


     Richard


--
No virus found in this incoming message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.23.0/1381 - Release Date: 4/16/2008
9:34 AM