why is python slow?

John Roth johnroth at ameritech.net
Fri Mar 8 07:29:22 EST 2002


"les ander" <les_ander at yahoo.com> wrote in message
news:a2972632.0203071841.7cd09181 at posting.google.com...
> Hi,
> i am just curious as to why different programming languages have
different
> speed. I understand that if a language has an extensive grammar
> (such as c++) the compiler would take longer.

Modern parsing technology just about eliminates any effect
of the grammer on compile speed, unless the parser needs to
do huge amounts of backtracking. What affects compile speed
is externals such as how many header (or whatever name you
call it) files need to be accessed for a compile, and how much
optimization you do.

> But what about execution?
> why is a perl program faster than similar python program?

There's no good evidence that Perl is substantially faster than
Python. It varies by application.

> For example
> when java came out it use to be pretty slow, but now it is pretty
fast. How
> was this speed-up acheived and why is it not possible to have such a
speed up
> for python?

Part of the speedup was relentless optimization by the various Java
licencees, and part was "just in time" compilation. So far, nobody has
worked on a JIT engine for Python. There's a vast difference in the
amount
of effort expended on Java as opposed to Python.

John Roth

>
> thanks
> les
>
> P.S. I am just trying to understand and do not intend to put down
python by
> any means.





More information about the Python-list mailing list