why is python slow?

Fernando Pereira pereira at cis.upenn.edu
Fri Mar 8 08:13:19 EST 2002


On 3/8/02 7:29 AM, in article u8hbcgr35p4f4 at news.supernews.com, "John Roth"
<johnroth at ameritech.net> wrote:

> 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.

Another reason is that a JIT compiler may not help Python as much as Java,
because every Python object must have a type tag, and those tags must be
checked by every operation, while type-tag checks are only needed in a few
places in Java (eg casts), and never for primitive types. Because of type
tag checks, there would be no long, easily optimizable straightline
instruction sequences, which is one of the things what makes JITC worth it
for Java. The other thing is inlining, which would be rather hard to do
given Python's dynamic nature.

-- F
 




More information about the Python-list mailing list