why python is slower than java?

Alex Martelli aleaxit at yahoo.com
Sun Nov 7 09:14:28 EST 2004


Maurice LING <mauriceling at acm.org> wrote:

> > Not really. It's an impression you could easily get from several
> > books about Python (e.g. O'Reilly's "Learning Python"), which
> > make a rather big deal about Python being slow to execute, but
> > fast to develop in.
> 
> Come to think of it, yes, "Python, The Complete Reference", "Programming
> Python" and "Learning Python" all seems to have that "speed warning" tag
> in the beginning chapters.
> 
> If this seems to be the wrong impression, should the authors do something?

I guess they should, if they care about what they're communicating.
This is how I put the issue in "Python in a Nutshell":

'''
Good compilers for classic compiled languages can often generate binary
machine code that runs much faster than Python code. However, in most
cases, the performance of Python-coded applications proves sufficient.
When it doesn't, you can apply the optimization techniques covered in
Chapter 17 to enhance your program's performance while keeping the
benefits of high programming productivity.
'''

I'm biased, having written this, but it seems a balanced set of
assertions which tries hard not to leave either wrong impression.


Alex



More information about the Python-list mailing list