Hi,

> The results are both interesting, and a little confusing. The main loop took
> 2560 seconds.  ObjectProxy.getProperty (mx utils) took 787 seconds.

Are you using ObjectProxies in your code? It may be the way you are accessing 
the data as well myAC[1].[“prop”] is AFAIK a lot slower than myAC[1].prop so if 
that the case I suggest your change your code to be this form. Using named 
Object may also improve performance considerably here.

> ListCollectionView.getProperty (mx.collections) took 713 seconds.

Looping over the source array directly will eliminate this.

>  Garbage Collection took 184 seconds.

That's still sizeable. To remove try and expanding the scope of any variables 
you have vared inside the loop to outside it. Be careful of temporary object 
created during string manipulation and the like (if you have any).

> ListCollectionView.getlength took 29 seconds(this is easily fixed).

Move the length calculation to outside the loops (I mentioned this before).

>  And the trig method I wrote only took 14 seconds.

Great you now know what to optimise first!

At a guess I’d first do this. Outside your loop add (with a better name of 
course):

var myArray:Array = myAC.source;

and change any references to myAC to myArray and I think you will see 
significant speed improvement. 

(This is assuming you have no filtering on the AC and the order in the AC 
doesn’t matter.)

Then rerun Scout and see what the differences are. Repeat until you got it down 
to your target time.

Perhaps run on a smaller set of data while making these changes then rerun at 
the end on the full set to confirm.

> I don't know if this is treating it more as an array or an array collection.

It’s treating like an array collection of object proxies this can be slow as it 
need to look up the properties many many times as the numbers show.

> I don't know if it would all process faster if I initially passed the 
> arraycollection data off
> to a regular array to do all of the processing.

From the numbers above I think this would be significantly faster, but it may 
depend on what else your code is doing. It’s simple enough to do so I’d give it 
a try first.

>  I need the object proxies because my itemrenderers won't bind to my 
> arraycollection otherwise.

Are you using ObjectProxies or a bindable named class?

> So the question now is, should I find an alternative to the ObjectProxies
> and try and optimize working with my array collection

That where I would spend my time at a guess you can make the above code lot 
faster (4-5x at least from the numbers) and that is likely to be better than 
using Workers alone.

People may also be able to help you a little more if you past a link to the 
code in question.

Thanks,
Justin

Reply via email to