If a collection, like an arraylist, will be storing custom objects (eg Person with several properties) in the thousands, is there anything to do in my code or in the constructor of the collection to prepare it for such a large collection.
I'm not really thinking of dedicated threads etc, but more along the lines of the load factor (do I need to touch this for the above scenario?).
Thanks
A different approach:
Since we are talking about such a Huge Collection, that would "Eat up" you RAM,
I think you should consider storing this collection in a database and read/write/update ONLY when you must.
You can do:
new ArrayList<T>(10000);
which pre-allocates the array with the specified size (e.g 10000) so that it doesn't have to re-allocate as you add elements. Apart from that, there is nothing you can do. Also - it doesn't matter to the ArrayList what kind of reference it is storing, so that information can't really help you in optimisation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With