How fast is the Google Web Toolkit?

S

segalsegal

Some people are in environments in which there is no Java on their
computers, and they've asked about using the Google Web Toolkit to get
our huge applet (~40,000 lines of code, 3 MB of data) running without
Java.

How well does the GWT approach scale? We tried a test of
multiplication, and it seemed that was 40 fold slower using the GWT -
JavaScript approach as compared with Java. Since the biggest
calculation in our software takes ~50 ms using Java, am I correct to
be concerned that it will take ~ 2 seconds using GWT?

Also, is there a good summary of the limitations encountered using GWT
instead of just staying in Java?
 
P

Peter D.

Some people are in environments in which there is no Java on their
computers, and they've asked about using the Google Web Toolkit to get
our huge applet (~40,000 lines of code, 3 MB of data) running without
Java.

How well does the GWT approach scale?  We tried a test of
multiplication, and it seemed that was 40 fold slower using the GWT -
JavaScript approach as compared with Java.  Since the biggest
calculation in our software takes ~50 ms using Java, am I correct to
be concerned that it will take ~ 2 seconds using GWT?

Also, is there a good summary of the limitations encountered using GWT
instead of just staying in Java?

I'm not sure if I understand your question fully. GWT is a Java ->
Javascript compiler. If you want to convert an entire Java application
to use GWT you need to take into consideration much more than
computation times. Does your Java application use a database? You are
using an applet. The GWT can only compile certain aspects of the Java
language into JavaScript not all of it. If you applet uses Threading
at all then you are out of luck since it is impossible to do any real
threading on the client JavaScript side.

GWT scales very well since you can use any language as the backend.
But if you are only looking to use it to convert Java to pure
JavaScript then I think your question should be "Does JavaScript scale
well?". Since in reality what you are looking to do is convert your
Java application into JavaScript (because thats what GWT does). The
JavaScript then makes RPC calls back to the server to get data.

Does this fit in with what you are doing?
 
A

Arne Vajhøj

segalsegal said:
Some people are in environments in which there is no Java on their
computers, and they've asked about using the Google Web Toolkit to get
our huge applet (~40,000 lines of code, 3 MB of data) running without
Java.

How well does the GWT approach scale? We tried a test of
multiplication, and it seemed that was 40 fold slower using the GWT -
JavaScript approach as compared with Java. Since the biggest
calculation in our software takes ~50 ms using Java, am I correct to
be concerned that it will take ~ 2 seconds using GWT?

JavaScript is traditionally much slower than Java.

But due to the popularity of AJAX there are a strong
focus on improving JavaScript performance. Google Chrome
came out with a new JavaScript engine invented by people
that previously did SUN HotSpot JVM.

But I am a bit skeptical about the entire discussion. My
impression is that GWT allows to code AJAX in Java. It is
not my impression that an arbitrary Java applet can be compiled
with GWT.

Arne
 
S

segalsegal

I'm not sure if I understand your question fully. GWT is a Java ->
Javascript compiler. If you want to convert an entire Java application
to use GWT you need to take into consideration much more than
computation times. Does your Java application use a database? You are
using an applet. The GWT can only compile certain aspects of the Java
language into JavaScript not all of it. If you applet uses Threading
at all then you are out of luck since it is impossible to do any real
threading on the client JavaScript side.

GWT scales very well since you can use any language as the backend.
But if you are only looking to use it to convert Java to pure
JavaScript then I think your question should be "Does JavaScript scale
well?". Since in reality what you are looking to do is convert your
Java application into JavaScript (because thats what GWT does). The
JavaScript then makes RPC calls back to the server to get data.

If someone has a good list of the limitations of the GWT approach as
compared to Java that would be helpful in assessing whether to try to
port to the GWT approach.

If someone has a good sense of how much slower computationally
intensive programs are in GWT (converted to JavaScript) as compared to
Java that would be helpful as well.
 
R

Roedy Green

Some people are in environments in which there is no Java on their
computers

Why would the GWT be acceptable to install where Java would not?

--
Roedy Green Canadian Mind Products
http://mindprod.com
PM Steven Harper is fixated on the costs of implementing Kyoto, estimated as high as 1% of GDP.
However, he refuses to consider the costs of not implementing Kyoto which the
famous economist Nicholas Stern estimated at 5 to 20% of GDP
 
P

Peter D.

Why would the GWT be acceptable to install where Java would not?

--
Roedy Green Canadian Mind Productshttp://mindprod.com
PM Steven Harper is fixated on the costs of implementing Kyoto, estimated as high as 1% of GDP.
However, he refuses to consider the costs of not implementing Kyoto which the
famous economist Nicholas Stern estimated at 5 to 20% of GDP

Javascript can run on the client side in a browser without the need
for a web server or a JVM... but I guess it all depends on the machine
the code is running on. Since Javascript is run in the users browser
and the browser runs on the users machine I guess it all depends on
the machine the person is running.

If the client has a P2 400mhz then the computationally intensive
routines will be slower than on a p4 3.0g. I know this is obvious but
the question being asked is just weird.

GWT is meant for applications that deal with lots of data and is based
on AJAX. If your application doesn't deal with a lot of data from a
database I highly doubt it would do you any good to port your app to
GWT. The strengths of GWT come with it's asynchronous method calls.
You can be drawing the GUI elements at the same time as fetching
results from a remote server which appears to the user as a very fast
response. This is the strength of GWT. It makes creating AJAX calls
very simple using only Java.

Also one thing to remember if you decide to port is that the GWT Java -
Javascript compiler might not do the most efficient compilation of
your Java code especially if it wasn't written well to begin with. You
would basically be trusting the compiler to create efficient
Javascript from your Java code.

ALso GWT has it's own widget library, you would need to code your Java
to take advantage of those new widgets in order to actually use GWT to
compile into Javascript. A SWT button is not the same as a Button in
GWT.

BTW when you did your tests in GWT I hope you didn't do them in
"Hosted Mode" because it is MUCH MUCH slower than the compiled
Javascript.
 
T

Tom Anderson

Why would the GWT be acceptable to install where Java would not?

The output of GWT is pure javascript. You don't have to install the GWT on
the client machines. You need to install its support libraries, but those
are also javascript, and delivered in the usual way.

tom
 
A

Arne Vajhøj

Roedy said:
Why would the GWT be acceptable to install where Java would not?

Sometime in the future there will probably be a
http://mindprod.com/GWT.html which explains that GWT is
a development tool and that Java and GWT are only needed
on the development machine and that the browser PC's
only need a JavaScript engine, because the Java code
is compiled to JavaScript.

:)

Arne
 
S

segalsegal

You don't have to install the GWT on the client machines.
You need to install its support libraries, but those
are also javascript, and delivered in the usual way.

Is the need to install GWT support libraries just for the developer or
for the end-user too? If for the end user, do they have to
specifically authorize a download or does it just work seamlessly?

On the speed issue, an article at http://news.cnet.com/8301-17939_109-10119149-2.html
compares JavaScript speed on various platforms, which is encouraging
since the 40 fold speed penalty for JavaScript versus Java was
measured on Safari and the ratio may be better on faster JavaScript
platforms. But the benchmarks that would be most useful is comparing
speed in Java versus the JavaScript resulting from running the same
code through the GWT process for converting to JavaScript.
 
S

segalsegal

Sometime in the future there will probably be ahttp://mindprod.com/GWT.htmlwhich explains that GWT is
a development tool and that Java and GWT are only needed
on the development machine and that the browser PC's
only need a JavaScript engine, because the Java code
is compiled to JavaScript.

I even checked the URL to see if Roedy Green jumped on this with his
usual speed. The GWT is an expression of the cross-platform vision of
Java, and if I can compile my Java code to JavaScript that is fine
with me as long as it runs cross-platform.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top