Primitive Array vs ArrayList
arraylist, arrays, java
Solution
Primitive arrays are much more efficient, as they don't require wrapper objects. Guava has List implementations that are backed by primitive arrays (example: `Ints.asList(int[])`), perhaps that could be a reasonable solution for you: get the power of a collection but only use Objects when you actually need them.
Problem
I am receiving XML and need to convert to either a primitive Array or ArrayList. Is there much difference in terms of performance in terms of memory and garbage collection? My application will be creating thousand of these objects every second and I need to minimize GC as I need real-time performance. Thxs