+1  A: 

I would be concerned about shipping that much data to the browser and processing it there. If I had hundreds of thousands of data points to process in a GWT app, I'd try to do most of the processing server side and just ship simplified views of that data to the browser to be displayed to the user.

Nat
I agree with your sentiment regarding trying to avoid doing too much client-side. I don't have much choice as I have implemented a timeseries graphing widget. Need to be able to pan through the data at various sample rates. Pulling in needed sections cached is possible, but I'd rather sacrifice memory to speed.
Jonathan Shore
There is no point in pulling all 200,000 points over to the browser for display, because the display is limited by the number of pixels in the x-direction. The browser can only display few hundred -- at most a couple of thousand -- of time points (unless you have an ENORMOUS monitor!). Therefore the server can calculate the graph points to display from the hundreds of thousands of time points and ship the few hundred graph points to the browser.
Nat
The widget needs to pan and resample in realtime and could not tolerate visible delay back to the server. This would require a jit prefetch windowed approach where the visibly series + pannable margin is fetched. Unfortunately, I have another dimension that can be changed in RT, the sampling rate (which you can think of as zoom). <br>An implementation that prefetches windows from a server would need to keep an instance of the series for other samples as well (for instance 1sec, 5sec, 5min, etc.<br>Will consider at later point. Problem resolved re: compilation.
Jonathan Shore
+1  A: 
bikesandcode
I did a test over the weekend. I had poor performance for both double[] and ArrayList in hosted mode after a period of time (it seems that hosted mode allowed an accumulation of garbage, slowing down significantly after 30mins or so.Found the compiled, unhosted to have good performance and none of the memory leakage I saw in hosted. As you indicate, testing needs to be done in non-hosted.
Jonathan Shore
A: 

JSArrayNumber is going to give you the most efficient mapping. ArrayList will box values for you, which will mean a object wrapper for every value. Even double[] will honor the Java initial value semantics (ensuring that every element is initialized to 0.0). JSArrayNumber will map directly onto JavaScript array holding primitive numbers.

There are some trappings here since JavaScript arrays can return undefined for uninitialized indexes and assigning to an index can actually change the length. You will have to take these into account. I usually create subclass of JsArrayNumber and use assertions to validate use.

Also, you don't have to use JSNI to instantiate a JsArrayNumber:

JSArrayNumber a = JavaSriptObject.createArray().cast();
Kelly Norton
Thanks for the note. There is one problem with the above though, if the class needs to live on both the JS and javascript sides, JavaScriptObject.createArray() does not have a Java counterpart. I could use a scheme that uses this approach if GWT.isScript() and a java approach if not script.
Jonathan Shore
Could also have a java-side version of the class and a JS-side implementation and use the class replacement mechanism ...
Jonathan Shore