Hi Jacob,
The difference between the two depends on what you do with them. The
emulated ArrayList provides a number of convenient features. If you use
ArrayList, you will definitely pay the cost of increasing the size of your
JavaScript, but that might not be a problem if you need these features
anyway. The implementations for the ArrayList convenience methods are
implemented as efficiently as possible, so you would end up having the same
speed of execution if you were using Array and implementing similar
functionality as the ArrayList class around the Array type.

You can take a look at the features available in the ArrayList by checking
out the emulated class source code at the link below. If you need these
features, by all means use the ArrayList class.

Emulated ArrayList class:
http://google-web-toolkit.googlecode.com/svn/trunk/user/super/com/google/gwt/emul/java/util/ArrayList.java

However, if you don't need these features, you will probably be better off
using a regular array.

Hope that helps,
-Sumit Chandel

On Mon, Jun 1, 2009 at 9:23 PM, Jacob <[email protected]> wrote:

>
> What is the difference in how arrays and arraylists end up in
> javascript? I am working on performing animations in parallel, and an
> arraylist would be very nice and easy to use, but if an array is
> faster, I can initialize for the common case and the resize the array
> as needed. Is there anything I could do that would be faster than an
> array or an arraylist for storing an arbitrary amount of animations?
> >
>

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