Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Porting Java web application to Python to make it faster?

Reply
Thread Tools

Porting Java web application to Python to make it faster?

 
 
Wolfgang Keller
Guest
Posts: n/a
 
      07-08-2004
Hello,

as a non-developer I am currently participating in an industrial "research"
project to develop a so-called "web application". This application serves
at the same time as middleware to connect several other "conventional"
enterprise-applications such as ERP, SCADA etc. and to provide a GUI
frontend to the users. The developers are into Struts, Enterprise Java
Beans and the like, so it will be entirely implemented in Java with all the
processing on the server side and only static HTML pages on the client
side. It will have to "emulate" much of the GUI logic of a conventional
interactive application with multiple Eclipse-like collapsable panes,
XForms-like dynamic forms, lots of expandable tree views and sortable lists
everywhere, plus SOAP communication "behind the scenes" to get and put
loads of data all over the company's network.

The developers say it will require "considerable" hardware resources in
order to allow reasonable response times, according to them >>1GByte of RAM
for a rather small workgroup (<10 concurrent users). From my own personal
experience with applications implemented in Java (such as UML and database
modeling tools etc.) I fear that this might in fact mean that the reponse
times will be Godot-like and that the application will miserably choke as
soon as we confront it with real-world amounts of data going beyond the
usual "three items" toy demonstrations.

Now the question: If this desaster scenario (I'm working for the industrial
application partner in the project who expects to get some results that
will be actually usable for everydays' work) will actually happen (I hope
it won't, but still...), might there be a chance that by paying a cs
student for porting it to Python in his diploma thesis using such things as
Coil, Cheetah, Webware etc. it will get slimmer and faster? And if so, by
how much approximately? 10%? One order of magnitude?

TIA,

Best regards,

Wolfgang Keller
 
Reply With Quote
 
 
 
 
Christopher Baus
Guest
Posts: n/a
 
      07-08-2004
> 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.

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.

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.

--
Christopher Baus
http://www.baus.net/

 
Reply With Quote
 
 
 
 
Wolfgang Keller
Guest
Posts: n/a
 
      07-08-2004
Am Thu, 8 Jul 2004 00:10:18 -0700 (PDT) schrieb Christopher Baus:

>> Omit discussion on enterprise application in java or python.


If I had wanted to create a flamewar, I would have cross-posted to
comp.lang.java.*

> Ok, I'll bite.


Thanks for the answer.

> 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.


Errr, >>1 GByte just to provide an interactive GUI to something like 5
users and doing some inter-application communication - I wouldn't really
consider that as nothing. Especially not if it scales hyper-exponentially
with the number of users and/or the data volume. After this first
application, we expect to be able to use the same application for sites
with something like 100 concurrent users as well.

> 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.


The point is that this can be worked around by retrieving the data in
background and "caching" it in a local database. Sorry that I didn't
mention this. In fact such a database would have to be part of the
application, as some of the communication with other applications will have
to be offline, in "batch" mode, in both directions (get as well as put).

> In my opinion it would be a waste of money to redo this in python.


Hmm, are cs students THAT expensive even as interns? >:->

> If the developers are skilled in java, then go with java. If they prefer
> python then use it instead.


None of them has ever mentioned Python at all. >:->

Best regards,

Wolfgang Keller
 
Reply With Quote
 
Rick Lawson
Guest
Posts: n/a
 
      07-08-2004
Disclaimer: I love Python but write Java webapps (mainly Struts) for a
living.

I don't think the problem is Java, server side it is very fast. With a
good data access layer and caching (like Hibernate) I think that a
Java webapp will be hard to beat. Sounds like the problem is the
design decision to emulate a rich desktop app as a web based app.
Since this is an internal app you may want to suggest a desktop client
(either Java or Python based) communicating via Soap or xmlrpc. The
nice thing about doing an rich client app in Java for a limited
audience is you can Webstart it which makes for painless deployment.
On the other hand, I've had good luck writing wxPython based rich
clients and using Inno Setup to deliver a clickable installer.

Good luck,
Rick

Wolfgang Keller <(E-Mail Removed)> wrote in message news:<1inbbvrpmu1n6$.a0ikxbujiqk3$(E-Mail Removed)> ...
> Hello,
>
> as a non-developer I am currently participating in an industrial "research"
> project to develop a so-called "web application". This application serves
> at the same time as middleware to connect several other "conventional"
> enterprise-applications such as ERP, SCADA etc. and to provide a GUI
> frontend to the users. The developers are into Struts, Enterprise Java
> Beans and the like, so it will be entirely implemented in Java with all the
> processing on the server side and only static HTML pages on the client
> side. It will have to "emulate" much of the GUI logic of a conventional
> interactive application with multiple Eclipse-like collapsable panes,
> XForms-like dynamic forms, lots of expandable tree views and sortable lists
> everywhere, plus SOAP communication "behind the scenes" to get and put
> loads of data all over the company's network.
>
> The developers say it will require "considerable" hardware resources in
> order to allow reasonable response times, according to them >>1GByte of RAM
> for a rather small workgroup (<10 concurrent users). From my own personal
> experience with applications implemented in Java (such as UML and database
> modeling tools etc.) I fear that this might in fact mean that the reponse
> times will be Godot-like and that the application will miserably choke as
> soon as we confront it with real-world amounts of data going beyond the
> usual "three items" toy demonstrations.
>
> Now the question: If this desaster scenario (I'm working for the industrial
> application partner in the project who expects to get some results that
> will be actually usable for everydays' work) will actually happen (I hope
> it won't, but still...), might there be a chance that by paying a cs
> student for porting it to Python in his diploma thesis using such things as
> Coil, Cheetah, Webware etc. it will get slimmer and faster? And if so, by
> how much approximately? 10%? One order of magnitude?
>
> TIA,
>
> Best regards,
>
> Wolfgang Keller

 
Reply With Quote
 
Istvan Albert
Guest
Posts: n/a
 
      07-08-2004

Porting your application to python will not make it *faster* but you
will see a whole lot *sooner* what the problems, bottlenecks and unexpected
complexities are in your implementation. If possible draft and test
it in python then finalize it in Java.

Istvan.

 
Reply With Quote
 
Christopher Baus
Guest
Posts: n/a
 
      07-08-2004
>> 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.

>
> Errr, >>1 GByte just to provide an interactive GUI to something like 5
> users and doing some inter-application communication - I wouldn't really
> consider that as nothing. Especially not if it scales hyper-exponentially
> with the number of users and/or the data volume. After this first
> application, we expect to be able to use the same application for sites
> with something like 100 concurrent users as well.


And python will solve this problem how?

> Hmm, are cs students THAT expensive even as interns? >:->


If the CS students are so cheap, why don't you just have them write it in
the first place. If the project can be done by CS students why waste your
time on the Java engineers?

>> If the developers are skilled in java, then go with java. If they
>> prefer
>> python then use it instead.

>
> None of them has ever mentioned Python at all. >:->


If the architecture is the same, Python will likely save you nothing.
Python is a neat language. I like using it. But Java really is the big
player in this space, and it works fine. In many ways I think having a
strongly typed language like Java is better for production than Python,
but I'll leave that argument for another day.

Instead of wasting time having the CS student re-write the app in python,
have him or her look at why the app is slow or using excessive of memory.
That will be time better spent. The CS student might be less expensive,
but I'm sure your time isn't free either.
 
Reply With Quote
 
Irmen de Jong
Guest
Posts: n/a
 
      07-08-2004
Istvan Albert wrote:

>
> Porting your application to python will not make it *faster* but you
> will see a whole lot *sooner* what the problems, bottlenecks and unexpected
> complexities are in your implementation. If possible draft and test
> it in python then finalize it in Java.


This is actually a very good point! "mod parent up"


--Irmen
 
Reply With Quote
 
flab ba
Guest
Posts: n/a
 
      07-09-2004

I agree with the folks that responded ... it probably wouldn't be
worthwhile to convert your app to Python. I think Java is better for your
type of project - not because the language is superior to Python (I don't
think it is), or because Java has static type checking (for an interesting
discussion why, see the following link, but remember testing is the key):

http://www.artima.com/weblogs/viewpost.jsp?thread=4639


, but because Java has better libraries and frameworks for exactly this
type of thing.

Your developers *may* want to consider Turbine/Velocity or Tapestry as an
alternative to Struts.

Also, as another poster mentioned, a thick client that communicates by web
services might be better ... maybe look into the Eclipse Framework.

Instead of worrying about what language to use at this point in time, I
would employ the principles in this book :

Performance by Design : Computer Capacity Planning By Example by Daniel A.
Menasce, Lawrence W. Dowdy, Virgilio A.F. Almeida

http://www.amazon.com/exec/obidos/tg...glance&s=books

And make sure you do some architectural experimentation. Evaluate a *few*
competing alternative architectures to solve your problem. Make sure you
have data (from simulations, models) to back up your decision.

Don't forget to consider a load-generation tool like LoadRunner (expensive
as heck, though). Maybe you could find something cheaper that would fit
the bill.

-A









On Thu, 08 Jul 2004 08:53:19 +0200, Wolfgang Keller wrote:

> Hello,
>
> as a non-developer I am currently participating in an industrial
> "research" project to develop a so-called "web application". This
> application serves at the same time as middleware to connect several
> other "conventional" enterprise-applications such as ERP, SCADA etc. and
> to provide a GUI frontend to the users. The developers are into Struts,
> Enterprise Java Beans and the like, so it will be entirely implemented
> in Java with all the processing on the server side and only static HTML
> pages on the client side. It will have to "emulate" much of the GUI
> logic of a conventional interactive application with multiple
> Eclipse-like collapsable panes, XForms-like dynamic forms, lots of
> expandable tree views and sortable lists everywhere, plus SOAP
> communication "behind the scenes" to get and put loads of data all over
> the company's network.
>
> The developers say it will require "considerable" hardware resources in
> order to allow reasonable response times, according to them >>1GByte of
> RAM for a rather small workgroup (<10 concurrent users). From my own
> personal experience with applications implemented in Java (such as UML
> and database modeling tools etc.) I fear that this might in fact mean
> that the reponse times will be Godot-like and that the application will
> miserably choke as soon as we confront it with real-world amounts of
> data going beyond the usual "three items" toy demonstrations.
>
> Now the question: If this desaster scenario (I'm working for the
> industrial application partner in the project who expects to get some
> results that will be actually usable for everydays' work) will actually
> happen (I hope it won't, but still...), might there be a chance that by
> paying a cs student for porting it to Python in his diploma thesis using
> such things as Coil, Cheetah, Webware etc. it will get slimmer and
> faster? And if so, by how much approximately? 10%? One order of
> magnitude?
>
> TIA,
>
> Best regards,
>
> Wolfgang Keller

 
Reply With Quote
 
Paul Boddie
Guest
Posts: n/a
 
      07-09-2004
"Christopher Baus" <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
> > 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
 
Reply With Quote
 
Mark 'Kamikaze' Hughes
Guest
Posts: n/a
 
      07-09-2004
Christopher Baus <(E-Mail Removed)>
wrote on Thu, 8 Jul 2004 00:10:18 -0700 (PDT):
>> 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.
> 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.
> 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.


I agree. For a living, I write Python when I can, Java most of the
time, and PHP when necessary. For fun, I write games in Java and
Python, or work on my web site in PHP. Performance matters quite a bit
to what I do.

Java's startup time is awful, but its performance once it's started is
really very good. Python starts up faster, but it's not that fast a
language. Java uses an insane amount of memory by old-time standards,
but an equally-powerful Python program will use as much or more.

Python's certainly more pleasant to work with, but Java
Servlets/JSP/Taglibs are the best balance of power and ease of use in
web frameworks, and JDBC handles database interaction better than
anything I've ever seen: it doesn't gloss over what the database really
does, but presents the highest-level tools possible.

If the actual developers know Java and think it's the right tool for
the job, they're almost certainly right.

--
<a href="http://kuoi.asui.uidaho.edu/~kamikaze/"> Mark Hughes </a>
"The void breathed hard on my heart, turning its illusions to ice, shattering
them. Was reborn, then, free to scrawl own design on this morally blank
world. Was Rorschach." --Alan Moore, _Watchmen #6_, "The Abyss Gazes Also"
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Porting C# Application to Java, Different results. Berlin Brown Java 12 05-07-2012 04:54 PM
"Porting" a desktop app to a web application - best practices ? (2b|!2b)==? ASP .Net 1 03-17-2008 12:37 PM
Porting a C++ application to a Web application Bartholomew Simpson ASP .Net 2 06-19-2007 03:21 PM
Advice for Porting existing VB.NET App to ASP.Net Web Application Nate ASP .Net 2 02-18-2004 01:18 AM
Porting web-based application to offline at google Java 1 02-10-2004 11:44 PM



Advertisments