I was wondering if there are any plans to use linked lists for
iterating through all the various meshes, primitives, lights, etc... ?
It seems like Dictionary is used for everything, but according to my
speed tests linked lists are quite a bit faster. I'm not sure how much
of a boost it would really give but for 5,000,000 iterations here are
my numbers:

linked list: 37ms
for loop: 67ms
dictionary: 179ms
while:  38ms

Here's the iteration code I'm using: The array, linked list, and
dictionary are already built before timing. obj is a typed variable
that has a "nxt" variable to point to the next object in the list.
These numbers are from FP10 release version; numbers are similar with
debug version, but all slightly slower.

                        var time:uint = getTimer();
                        for (i=0; i < len; ++i) {
                                obj = list[i];
                        }
                        time = getTimer() - time;
                        trace("for loop: " + time);
                        debugText.appendText("for loop: " + time + "\n");

                        time = getTimer();
                        obj = list[0];
                        var val:Number = 0;
                        while (obj = obj.nxt) { }

                        time = getTimer() - time;
                        trace("linked list: " + time);
                        debugText.appendText("linked list: " + time + "\n");


                        time = getTimer();
                        for each (obj in dict) {

                        }
                        time = getTimer() - time;
                        trace("dictionary: " + time);
                        debugText.appendText("dictionary: " + time + "\n");

                        time = getTimer();
                        i = 5000000;
                        while (i--) {
                                obj = list[i];
                        }
                        time = getTimer() - time;
                        debugText.appendText("while: " + time + "\n");

This may not have a huge impact, but I thought I'd throw it out there.

Reply via email to