Performance java vs. python

Mohan Parthasarathy suruti94 at gmail.com
Tue May 19 14:42:40 EDT 2009


On Tue, May 19, 2009 at 10:42 AM, Daniel Fetchinson <
fetchinson at googlemail.com> wrote:

> >> >> On the one hand, there are developers who love big IDEs with lots of
> >> >> features (code generation, error checking, etc.), and rely on them to
> >> >> provide the high level of support needed to be reasonably productive
> >> >> in heavy-weight languages (e.g. Java).
> >> >>
> >> >> On the other hand there are developers who much prefer to keep things
> >> >> light-weight and simple.  They like clean high-level languages (e.g.
> >> >> Python) which are compact enough that you can keep the whole language
> >> >> in your head, and require only a good text editor to be used
> >> >> effectively.
> >> >
> >> >This distinction is IMHO not correct. If you took a look at Java, you
> >> would
> >> >notice that the core language syntax is much simpler than Python's.
> >>
> >> That's half-true.  The problem is that you have to digest a much bigger
> >> chunk of Java before you can start being productive.  Consider how
> simple
> >> it is to write a non-regex grep in Python.  In addition, Python's object
> >> model is simpler than Java's, not even talking about the contortions
> that
> >> Java's static class model forces you into.
> >
> >
> > I am new to Python. I am slowly realizing that Python might be a better
> > choice when compared to java on the server side. Is there any performance
> > comparison between Java and Python ? For example, if I use the J2EE
> solution
> > vs. python (Django etc.) on the server side, would one perform better
> over
> > the other ?
>
> Benchmarks always test for a given feature. The available benchmarks
> will most likely not test the feature relevant for your particular
> application simply because there are about a gazillion different ways
> of using a web framework. So the best you can do is simply test the
> bottleneck part of your application and see for yourself, otherwise
> you will be left with comments like "django is used at work because
> it's faster for us" or "I use j2ee because performance is better for
> my web app". When it will come to choosing your framework these will
> help little to none.


Ah! I should have been careful before asking such "general" question about
performance. I agree with you. But mine was more academic. I should not
given a specific example.

AFAIK, for java on the client side, JVM performance is one of the critical
things which has been tuned to death until now. Even Google's Android which
uses Java for the programming language uses a Dalvik Virtual machine which
was spefically designed to handle low CPU, memory and power environments.
Similarly, Python can also be used to program on Nokia phones etc. Of course
programming natively (C/C++) would make a difference in environments where
CPU, memory and power are a big constraint. Given the context, do we know
how Python compares with Java or even native programming. What is the
overhead of  Python's interpreted code ? Some standard benchmarks would help
compare apples to apples  though it may not help deciding which framework to
choose.

-mohan


>
> Cheers,
> Daniel
>
> --
> Psss, psss, put it down! - http://www.cafepress.com/putitdown
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090519/ce5cf522/attachment.html>


More information about the Python-list mailing list