Following my earlier post on using vectors to Z-sort instead of arrays, I've updated Ralph Hauwerts SimpleZSorter util class released back in late 2008 on Lee Brimelows flash blog.
The change isn't a massive one, but does speed things up - simply it replaces the old:
important: turns it this runs slower if the z-val is outside of the range 0-1; a LOT slower, so don't use!
sortArray.sortOn("screenZ", Array.NUMERIC | Array.DESCENDING);
with the new:
sortVector.sort( function compare( x : SimpleZSortVO , y : SimpleZSortVO ) : int { return x.screenZ - y.screenZ; } );
and here's the source all nicely zipped up, you should be able to simply drop this in your fp10 swfs as a replacement for the older version,
Thanks to Ralph for one opensourcing it and two giving me a heads up that its okay to "upgrade", sure it can still be made faster still with a bit of thought.

















Hi,
Always worth remembering that "x.screenZ - y.screenZ" only works for integers, ie (int)(0.2 - 0.1) = 0 -> same number.
Huge.
have you tried/compared with the QuickSort algorithm ?
( http://haxe.org/doc/snip/quicksort )