On 12/14/2012 11:41 PM, 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.

Did you write the algorithm yourself, or did you port it from an
existing implementation? IOW, how do you know the implementation is
robust (always finds a solution)? Will this algorithm always converge on
a solution, no matter the data set?

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

Given how little we know about your implementation, it's not really
possible to say. However, in general, Javascript is not good (i.e. fast)
at these kinds of problems. In your case, performance will depend on the
Javascript engine. You did not say which engine you used (V8, Rhino,
SpiderMonkey).

> -  What kind of delays can I expect sending 5,000 doubles from the
> server back to the client
You'll be sending the values as string representations, so it depends on
the precision. At 8 characters per number (which includes encoding
overhead, however I don't know what precision you want. I'm guessing 4-5
decimal places, normalized) * 5K * 2 is quite feasible. This gets you
into RPC (remote procedure call) territory. I assume you're using the
GWT GUI to graph the results, so you're sending input up and getting
results back.
 
> - Should I just resort to doing the whole thing in Java and forget
> about GWT al together?

Use Google App Engine for the backend (via GWT RPC), GWT GUI for the
frontend. It sounds like you're well within the bounds of App Engine
compute quotas. You don't have to use App Engine. If you have access to
your own Java server, that will work just as well.

> - 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)?
No. You'd have to deploy a Java applet. However, you can split the work
using the App Engine or your own Java server.

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

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
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