why python is slower than java?

Alex Martelli aleaxit at yahoo.com
Sun Nov 7 02:40:35 EST 2004


Tim Roberts <timr at probo.com> wrote:

> Maurice LING <mauriceling at acm.org> wrote:
> >
> >I've already said the following and was not noticed:
> >
> >1. it is a disk intensive I/O operation.
> >2. users delay is not in the equation (there is no user input)
> >3. I am not interested in the amount of time needed to develop it. But
> >only interested execution speed.
> 
> It is fabulous that you are able to enumerate your list of requirements so
> completely.  I'm quite serious; many people embark on even complicated
> projects without a clear understanding of the tradeoffs they will
> encounter.
> 
> However, given that set of needs, why would you mess with an "exotic"
> language at all?  Why wouldn't you just write straight to the metal in C++
> or C?

Perhaps because point 3 has _never_ been true as stated?  Nobody would
really be happpy to take 40 years more to develop a program in order to
shave a second off each hour-long run (well, maybe somebody _has_ taken
that choice 30 years ago, and we'll see their program in 10 more years).
There is always, at some point, a tradeoff - the only issue is where.
Otherwise, "to the metal" would be assembly or microcode, btw.

If a program is anyway spending its time waiting for disk, network, or
other I/O, the benefits of compressing the already-small CPU part are
tiny, by Amdahl's Law.  On the other hand, ease of experimentation with
different program architectures -- for example trying to overlap some of
the I/O waits rather than serialize them -- could still help.


Alex



More information about the Python-list mailing list