In all fairness, iterating is fine, but populating is a different issue and it becomes quite time consuming once you get into higher orders of elements, as it performs copying to another collection. So if you can get the number of elements upfront and accommodate, it's for the best.
I have yet to be in such a situation yet, though. So Lists it is.
4
u/FrogTrainer Oct 31 '19
Think how fast we can iterate over those primitive arrays without the overhead of clunky Lists on our 16 core 4ghz CPUs. Will save so much time!