Hi,

> for (length of array collection = 38k)
>  for (length of array collection = 38k)
>    if condition one is met
>      if condition two is met
>        if condition three is met
>          if condition four is met
>            if condition five is met
>              if condition six is met
>                if condition seven is met
>                  if condition eight is met
>                    if condition nine is met
>                      if condition ten is met
>                        [Do a whole lot of trig calculations]

There probably a lot of ways this can be optimised:
- make sure the lengths are collated out side of the loops and not each time 
around/inside the loop
- if the array collection is bindable (I hope not) turn off updates
- loop around the array inside the array collection not the array collection 
itself (this I’d guess give a significant performance increase)
- are the conditions in increasing order of cost / can the order be changed?
- if the arrays were sorted in some way would you need to loop over it twice?
- can the calculations be cached in some way?
- are there any string manipulation or other temporary variable being created 
causing frequent garbage collection?

I’s suggest you run scout over it to see what is taking the most time and see 
if that can be optimised.

However for this to be really scalable you might want to look into map / reduce 
[1] and not use ActionScript to perform the calculations.

Thanks,
Justin

1. https://en.wikipedia.org/wiki/MapReduce

Reply via email to