Python too slow?

bruno.desthuilliers at gmail.com bruno.desthuilliers at gmail.com
Wed Jan 9 18:02:57 EST 2008


On 9 jan, 21:46, "dongie.ag... at gmail.com" <dongie.ag... at gmail.com>
wrote:
> Thanks for the clarification.
>
> Though I was hoping someone could give me a definitive answer.

Sorry - but I'm definitively not the right person on this...

>  I was
> quite excited about this project initially, but seeing the actual
> execute times was a big downer. Seeing that the original laser marker
> by GRL Vienna is done in Processing which from what I know is built on
> Java, I was hoping that Python would be up to a similar task.

Java's declarative static typing allow agressive just-in-time
optimizations - which is not the case in Python due to it's higly
dynamic nature[1]. You may want to have a look at psyco (a JIT
compiler) or to look for other angles (if there's any - IIRC the
example you're talking about already uses at least PIL for image
processing and something like scipy or numpy for intensive math ops).

If none of the two above answers fits your needs, and no Python Guru
comes with a better answer, then I'm afraid you'll have to go for a
language with a faster implementation. Python is quite faster nowadays
than it used to be, and is usually fast enough for most day-to-day
programming tasks (a, but it's still not as highly optimized as some
Lisp implementations (to compare to another highly





[1] you can read more on this on the pypy website, and specially here
IIRC: http://codespeak.net/pypy/dist/pypy/doc/dynamic-language-translation.html)



More information about the Python-list mailing list