if you have a lots of elements on the stage, most of the time is probably spent rendering them.
also, it matters only little, how the child-list of DisplayObjectContainer
is implemented, since the cost for function calls is orders of magnitude higher than access of Vector
s or Array
s. I guess in fact the child-list is implemented using a C/C++ collection, instead of having all the overhead coming from ActionScript builtin collections.
So yes, storing all children in a Vector will allow faster lookup, although deletion will become expensive. Even insterting will become either more expensive (if you override all child manipulation methods to update the vector when making changes and listen to remove events) or more difficult.
you should run your game with the root sprite turned invisible, to see how much it consumes.
From my experience, this optimization will not yield any signifficant speedup. You should rather try to learn about existing optimization techniques for flash games.
greetz
back2dos