Porting Java web application to Python to make it faster?

Paul Boddie paul at boddie.net
Fri Jul 9 12:48:26 CEST 2004


"Christopher Baus" <christopher at baus.net> wrote in message news:<mailman.93.1089270641.5135.python-list at python.org>...
> > Omit discussion on enterprise application in java or python.
> 
> Ok, I'll bite.
> 
> There was thread on a another list that I read like this recently. The
> difference in performance between Java and python on the web server
> probably doesn't really matter that much.  If anything I might guess that
> Java would be faster.  Tons of huge applications are run by Java servers
> everyday.  A gig of RAM on the server is nothing.  It might cost a couple
> hundred dollars. Big deal.  Certainly much less that re-writing the app in
> python.

I think previous discussions reached a certain consensus that Java
would possibly scale better "out of the box" with more hardware thrown
at it, whereas a single Python process doesn't benefit hugely from
having more CPUs thrown at it. However, Python Web application
frameworks seem to employ a more varied set of architectures for
distributing work than the average non-clustered Java application
server; whether a single Python process can effectively use 8 CPUs
becomes less relevant in that context.

Usually when people start comparing Java to the "P languages", it's
often noted that the initial application footprint of those languages
is more modest than Java - one particular Java application server
really gets upset unless it has 512MB to start up in, for example.
Yes, it could well be possible that with a server farm the size of the
Moon, Java applications will scale to make good use of it, but the
issue is whether you'd need to be so extravagant with, say, Apache and
mod_python.

> The performance problems will result from aggregating content from the
> sources you mention.  My guess is you'll be waiting around for the ERP to
> respond longer than it take will render the pages in either java or
> python.

Apparently, the Apache Cocoon people have done work with aggregating
information from SAP. However, my personal experience is that
functionally sufficient frameworks could be implemented with
mod_python and libxslt with equivalent performance and without the
"horsing around in the sitemap" that Cocoon applications demand.

> In my opinion it would be a waste of money to redo this in python.  If the
> developers are skilled in java, then go with java.  If they prefer python
> then use it instead.
> 
> The only thing you will prove is that the app can be done in python or
> java.  If anything Java is the proven leader in this field.

It's safer to go with Java, yes, and if you don't have to do the work
yourself then you could possibly save yourself the hassle of
justifying an alternative solution. However, I've found the
aforementioned alternative technologies to be invaluable in
prototyping solutions, and I'd be confident in deploying those
prototypes in a slightly more polished form instead.

Paul



More information about the Python-list mailing list