As can be seen here, javascript is a lot slower than java for doing number 
crunching: 
http://dyn.com/browsers-vs-servers-using-javascript-for-number-crunching-theories/

So, 2 seconds to 25 seconds is possible. It does feel a bit high though, 
which browser are you testing in? Difference between browsers for 
javascript number crunching can be very large.

Your solution to move that calculation to the server is actually very easy. 
You can use built in GWT-RPC to make a call to the server to run the 
calculation there and then send back the answer.

https://developers.google.com/web-toolkit/doc/latest/tutorial/RPC

On Saturday, December 15, 2012 8:41:09 AM UTC+2, Sami Kanderian wrote:
>
> Dear all,
>
> I am fairly new to GWT and wrote my first App where everything runs client 
> side. Here is my problem that I would like some advice on. I have the 
> opposite problem than most people dealing with performance issues.
> I am doing some serious number crunching where hundreds of thousands of 
> flops (computations) take place behind a GUI that I created with Smart-GWT. 
> When the code runs in hosted developer mode, the typical response time is 2 
> seconds which is acceptable. However, once I compiled the code into 
> JavaScript and ran it on the web in production mode the response time went 
> up to 25 seconds. This kind of performance is not acceptable. I put timers 
> in my code and know for a fact that this huge delay takes place an 
> iterative nonlinear least squares solution finding routine (basically a lot 
> of number crunching). This was a real let down.
>
> I decided to use GWT rather than pure Java due to the portability of the 
> App to multiple platforms. However the JavaScript performance is 
> unacceptable. My question is:
>
>  - Is it worth moving the heavy number crunching from the client to a 
> server where it still takes place in Java?
> -  What kind of delays can I expect sending 5,000 doubles from the server 
> back to the client
> - Should I just resort to doing the whole thing in Java and forget about 
> GWT al together?
> - In its final form, is there a way for the code to run with a JavaScript 
> based GUI but have Java run the hardcore computations on the back end all 
> happening client side? In other words, Can my web app run like it does in 
> developer mode when deployed on my website (make production mode run like 
> it does in developer mode when deployed)?
>
> I would appreciate any advice on this matter.
>
> Thank you.
>
> Sami
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/0de3nhLhrAYJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to