I’m storing a group of objects that will have methods called on them (update(), render()) every frame inside an ArrayList. What I’m wondering is if it would be faster to use a LinkedList since I will never grab an item from the middle. Everytime I use the data structure I will be doing a complete sequential traversal.
I was originally doing this with a LinkedList, but I ran into problems with concurrent modification while using an iterator to traverse the list. The concurrent modification was because of awt events which were on a seperate thread. I figured I could avoid this by storing all the events in a queue and processing them at the correct time, but I’ve moved on to lwjgl since then and I don’t think it will be a problem.
I’m also thinking of writing my own data structure for doing this so that I can avoid casting from Object, but I’m not sure if I should implement it as a linked structure or an array based structure (only worried about speed really).
I realize this isn’t exactly a performance bottleneck but I’m just wondering about it because I’m writing some reusable code that should be as efficient as possible.
