performance - Efficient representation for large numeric arrays in GWT -


I have a class repeatedly, 100K-200K value during the course of a day (basically the market tick, equally Sample). The most performing representation on the Java side is to use double [] (unlike the list). I am suspicious that the map of this approach is well reproduced.

On the side of Java, the double [] array should be expanded from time to time (i.e. allocate a new array and copy the old one in the new one). For example, there is a method like class:

  public zeros add (long time, double price) {... if (_len == _prices.length) extension (); _press [_len ++] = value; ...} Private Zero Extension () {Last Double [] newprices = New Double [_prices.length + 1024]; System.arraycopy (_prices, 0, newprices, 0, _len); _prices = newprices; }  

Now there is a separate array model of JavaScript, and allows indexing to incrementally extend the incremental extension beyond the final index, through indexing.

GWT has a JSERre numeric, which allows one to see and manipulate JS numeric arrays. JSERAT is meant to be the sign of withdrawal from JS and it can not be done immediately (yes JSI can alert some conditional use of JSI, but ugly).

The question is, in GWT, is the data structure used in Java class to get the best mapping for JS representation? I'm looking for the most performing methods for the following tasks:

  • Adding value to bar items (increasingly growing)
  • Repeated access Doing (often a part of it will scan by index) / li>

What is ArrayList & lt; Double>, for example, there is a bit of a map to javascript in JavaScript? There may be better mapping in it, use the double double [].

The most efficient mapping for you. ArrayList will be a box value for you, which means the object will be wrapped for each value. Even dual [] Java will respect the initial value semantics (make sure that each element is initialized for 0.0). JSROM will map the JavaScript array that basically captures the basic numbers.

Here are some trapings because JavaScript arrays can not be undefined for indispensable indexes and can specify the index can actually change the length. You have to keep in mind that I usually make sub-classes of JSARRAM and use the claim to validate the usage.

In addition, you do not have to use JSNi to Instant JSER:

  JSArrayNumber a = JavaSriptObject createArray () cast () .;  

Comments

Popular posts from this blog

c++ - Linux and clipboard -

Visual Studio 2005: How to speed up builds when a VSMDI is open? -

booting ubuntu from usb using virtualbox -