Python too slow?

Paul Boddie paul at boddie.org.uk
Fri Jan 11 12:52:17 EST 2008


On 10 Jan, 21:47, Ed Jensen <ejen... at visi.com> wrote:
> Bruno Desthuilliers <bruno.42.desthuilli... at wtf.websiteburo.oops.com> wrote:
> > I fail to see how the existence of JIT compilers in some Java VM changes
> > anything to the fact that both Java (by language specification) and
> > CPython use the byte-code/VM scheme.
>
> While your answer was technically correct, by omitting pertinent
> information, your answer lead readers to the wrong conclusion.

Indeed. A perusal of the Java VM architecture documents plus any
discussions around dynamic language support (and there's a discussion
group about that very topic) reveal a number of differences between
the CPython VM and Sun's Java VM. Moreover, despite claims about the
Sun VM only being one of many, it holds a fairly similar position to
that of the CPython VM in its own part of the computing world, with
adoption only likely to increase now that it's open source. (And many
new adopters were quite possibly using stuff like gcj previously
which, as many will already know, is a native code compiler for Java.)

These days, I seriously doubt that anyone uses the term "interpreted"
to mean "parses the source text and works out what to do, over and
over again as the program runs". Instead, I imagine that the term
typically suggests the presence of a virtual processor doing what all
processors do: interpret instructions. It's just that when native code
is produced, we look away from the process of interpretation done by
the hardware and consider it as the plain "on the metal" execution of
the code. Sure, Sun's Java VM may not remove such a virtual processor
entirely from the overall execution of a program, and the output of
gcj may include the invocation of lots of moderately expensive library
calls, but in contrast with CPython, some sequences of instructions
will not ultimately be interpreted by the virtual machine at run-time.

All this said, there are options other than CPython, and I imagine
that they will become even more interesting to mainstream Python users
over the next months and years.

Paul



More information about the Python-list mailing list