Flex components use virtualization. A DataGrid with 10000 data items only
creates enough renderers as you can see on the screen, which might top out
around 900 renderers (30x30 grid). That's different than any of your
proposed solutions in that we don't create 10000 renderers and add/remove
the ones required, we simply re-use renderers.
Correct me if I am wrong, but I believe that solution works because the item is highly repeatable, meaning that item renderer takes on the same parameters for each item. Also, will using virtualization with graphics work as well as it does with data? It seems that a lot of dataGrids(dataGroups in flex 4) are meant primarily for data (as in text), and not graphics.
There are certainly efficiencies to be gained because the data is supposedly
of the same format, but I would expect that each of your TextFields is
displaying text, and each of your sprites is displaying hopefully simple
graphics. There might be other gains by aggregating sprites as flex 4 does
with GraphicElements and Group.
Can you go into more detail on aggregating sprites as flex 4 does with GraphicElements and Group. I tried using GraphicsElements with a Group that used clipAndEnableScrolling, but that ran slower than using sprites.
I just wanted to bump this to see if anyone had any other ideas to contibute.
Flex aggregates sprites by taking sets of graphic primitives (Rect, Line,
etc) and drawing them into one sprite instead of one sprite per primitive.
It does take some code to figure out how to aggregate so it might have run
slower for you in some situation.
The fundamental point is that on every frame, the player visits every Sprite
and TextField in existence. If you have 10000, that's like run a for (i=0;
i< 10000) loop 24 times a second. Cut that down and you should have better
idle time numbers, but the cost of cutting that down might be too much.